- base default shortcodes;

This commit is contained in:
nikitozzzzzzz
2018-10-22 21:53:43 +03:00
parent f4d4d48a98
commit 9e6cea911a
8 changed files with 181 additions and 15 deletions
+11 -5
View File
@@ -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 );
+12 -2
View File
@@ -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 );
}
}
+3 -3
View File
@@ -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>
&nbsp;
<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>