mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
- base default shortcodes;
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
.um-admin.post-type-um_form .manage-column.column-id {width: 60px}
|
||||
.um-admin.post-type-um_form .manage-column.column-mode {width: 100px}
|
||||
.um-admin.post-type-um_form .manage-column.column-is_default {width: 60px}
|
||||
.um-admin.post-type-um_form .manage-column.column-title {width: 200px}
|
||||
.um-admin.post-type-um_form .manage-column.column-shortcode {width: 200px}
|
||||
.um-admin.post-type-um_form .manage-column.column-impressions {width: 100px}
|
||||
|
||||
@@ -90,11 +90,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) {
|
||||
*/
|
||||
function manage_edit_um_form_columns( $columns ) {
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['title'] = __( 'Title', 'ulitmatemember' );
|
||||
$new_columns['id'] = __('ID', 'ulitmatemember' );
|
||||
$new_columns['mode'] = __( 'Type', 'ulitmatemember' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ulitmatemember' );
|
||||
$new_columns['date'] = __( 'Date', 'ulitmatemember' );
|
||||
$new_columns['title'] = __( 'Title', 'ulitmate-member' );
|
||||
$new_columns['id'] = __('ID', 'ulitmate-member' );
|
||||
$new_columns['mode'] = __( 'Type', 'ulitmate-member' );
|
||||
$new_columns['is_default'] = __( 'Default', 'ulitmate-member' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ulitmate-member' );
|
||||
$new_columns['date'] = __( 'Date', 'ulitmate-member' );
|
||||
|
||||
return $new_columns;
|
||||
}
|
||||
@@ -134,6 +135,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) {
|
||||
echo UM()->shortcodes()->get_shortcode( $id );
|
||||
break;
|
||||
|
||||
case 'is_default':
|
||||
$is_default = UM()->query()->get_attr( 'is_default', $id );
|
||||
echo empty( $is_default ) ? __( 'No', 'ultimate-member' ) : __( 'Yes', 'ultimate-member' );
|
||||
break;
|
||||
|
||||
case 'mode':
|
||||
$mode = UM()->query()->get_attr( 'mode', $id );
|
||||
echo UM()->form()->display_form_type( $mode, $id );
|
||||
|
||||
@@ -1121,8 +1121,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
// save
|
||||
delete_post_meta( $post_id, '_um_profile_metafields' );
|
||||
foreach ( $_POST['form'] as $k => $v ) {
|
||||
if ( strstr( $k, '_um_' ) ){
|
||||
update_post_meta( $post_id, $k, $v);
|
||||
if ( strstr( $k, '_um_' ) ) {
|
||||
if ( $k === '_um_is_default' ) {
|
||||
$mode = UM()->query()->get_attr( 'mode', $post_id );
|
||||
if ( ! empty( $mode ) ) {
|
||||
$posts = $wpdb->get_col( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_um_mode' AND meta_value = %s", $mode ) );
|
||||
foreach ( $posts as $p_id ) {
|
||||
delete_post_meta( $p_id, '_um_is_default' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, $k, $v );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -298,11 +298,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
|
||||
ob_start(); ?>
|
||||
|
||||
<p>
|
||||
<?php printf( __( 'One or more of your %s pages are not correctly setup. Please visit <strong>%s > Settings</strong> to re-assign your missing pages.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_plugin_name ); ?>
|
||||
<?php printf( __( '%s needs to create several pages (User Profiles, Account, Registration, Login, Password Reset, Logout, Member Directory) to function correctly.', 'ultimate-member' ), ultimatemember_plugin_name ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo esc_attr( add_query_arg( 'um_adm_action', 'install_core_pages' ) ); ?>" class="button button-primary"><?php _e( 'Setup Pages', 'ultimate-member' ) ?></a>
|
||||
<a href="<?php echo esc_attr( add_query_arg( 'um_adm_action', 'install_core_pages' ) ); ?>" class="button button-primary"><?php _e( 'Create Pages', 'ultimate-member' ) ?></a>
|
||||
|
||||
<a href="javascript:void(0);" class="button-secondary um_secondary_dimiss"><?php _e( 'No thanks', 'ultimate-member' ) ?></a>
|
||||
</p>
|
||||
@@ -531,7 +531,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
|
||||
ob_start(); ?>
|
||||
|
||||
<p>
|
||||
<?php printf( __( 'Thanks for installing <strong>%s</strong>! We hope you like the plugin. To fund full-time development and support of the plugin we also sell extensions. If you subscribe to our mailing list we will send you a 20%% discount code for our <a href="%s" target="_blank">extensions bundle</a>.', 'ultimate-member' ), ultimatemember_plugin_name, 'https://ultimatemember.com/core-extensions-bundle/' ); ?>
|
||||
<?php printf( __( 'Thanks for installing <strong>%s</strong>! We hope you like the plugin. To fund full-time development and support of the plugin we also sell extensions. If you subscribe to our mailing list we will send you a 20%% discount code for our <a href="%s" target="_blank">extensions bundle</a>.', 'ultimate-member' ), ultimatemember_plugin_name, 'https://ultimatemember.com/core-extensions-bundle/' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
<div class="um-admin-metabox">
|
||||
<?php UM()->admin_forms( array(
|
||||
'class' => 'um-form-shortcode um-top-label',
|
||||
'prefix_id' => 'form',
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => '_um_is_default',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Default Form', 'ultimate-member' ),
|
||||
'tooltip' => sprintf( __( 'If you set this form as default you will have an ability to use %s shortcode for the displaying form at the page. Otherwise you will have to use %s', 'ultimate-member' ), UM()->shortcodes()->get_default_shortcode( get_the_ID() ), UM()->shortcodes()->get_shortcode( get_the_ID() ) ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_is_default' ),
|
||||
'options' => array(
|
||||
0 => __( 'No', 'ultimate-member' ),
|
||||
1 => __( 'Yes', 'ultimate-member' ),
|
||||
),
|
||||
),
|
||||
)
|
||||
) )->render_form(); ?>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
|
||||
<p><?php echo UM()->shortcodes()->get_shortcode( get_the_ID() ); ?></p>
|
||||
<p><?php echo UM()->shortcodes()->get_default_shortcode( get_the_ID() ); ?></p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user