- added redirect after metatable settings upgrade

This commit is contained in:
nikitasinelnikov
2020-01-03 12:49:26 +02:00
parent 53a3b037d1
commit 26065a1aa3
4 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ jQuery(document).ready( function() {
} }
}); });
} else { } else {
return false; window.location = um_forms_data.successfully_redirect;
} }
} }
} }
@@ -228,6 +228,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
wp_enqueue_style( 'um_admin_forms' ); wp_enqueue_style( 'um_admin_forms' );
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true ); wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true );
wp_localize_script( 'um_admin_forms', 'um_forms_data', array(
'successfully_redirect' => add_query_arg( array( 'page' => 'um_options', 'tab' => 'misc', 'msg' => 'updated' ), admin_url( 'admin.php' ) ),
) );
wp_enqueue_script( 'um_admin_forms' ); wp_enqueue_script( 'um_admin_forms' );
} }
+11 -4
View File
@@ -579,10 +579,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
), 4 ); ), 4 );
} else { } else {
if ( isset( $_GET['msg'] ) && 'updated' == $_GET['msg'] ) { if ( isset( $_GET['msg'] ) && 'updated' == $_GET['msg'] ) {
$this->add_notice( 'upgrade', array( if ( isset( $_GET['page'] ) && 'um_options' == $_GET['page'] ) {
'class' => 'updated', $this->add_notice( 'settings_upgrade', array(
'message' => '<p>' . sprintf( __( '<strong>%s %s</strong> Successfully Upgraded', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version ) . '</p>', 'class' => 'updated',
), 4 ); 'message' => '<p>' . __( 'Settings successfully upgraded', 'ultimate-member' ) . '</p>',
), 4 );
} else {
$this->add_notice( 'upgrade', array(
'class' => 'updated',
'message' => '<p>' . sprintf( __( '<strong>%s %s</strong> Successfully Upgraded', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version ) . '</p>',
), 4 );
}
} }
} }
} }
@@ -131,6 +131,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
update_option( 'um_member_directory_update_meta', time() ); update_option( 'um_member_directory_update_meta', time() );
UM()->options()->update( 'member_directory_own_table', true );
wp_send_json_success(); wp_send_json_success();
} elseif ( 'um_get_metadata' == $_POST['cb_func'] ) { } elseif ( 'um_get_metadata' == $_POST['cb_func'] ) {
global $wpdb; global $wpdb;