mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 14:43:49 +09:00
Improved load time
This commit is contained in:
@@ -1299,6 +1299,9 @@
|
||||
* @return void
|
||||
*/
|
||||
public function _options_page() {
|
||||
|
||||
$um_admin = new UM_Admin_API();
|
||||
|
||||
$this->import_export->in_field();
|
||||
|
||||
if ( $this->args['menu_type'] == 'submenu' ) {
|
||||
@@ -1307,7 +1310,11 @@
|
||||
|
||||
add_menu_page( __('Ultimate Member', $this->slug), __('Ultimate Member', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page'), 'dashicons-admin-users', '50.78578');
|
||||
|
||||
add_submenu_page( '_welcome_to_um', __('Welcome to Ultimate Member!', $this->slug), __('Welcome to Ultimate Member!', $this->slug), 'manage_options', $this->slug . '-welcome', array(&$this, 'admin_page') );
|
||||
foreach( $um_admin->about_tabs as $k => $tab ) {
|
||||
|
||||
add_submenu_page( '_'. $k . '_um', sprintf(__('%s | Ultimate Member', $this->slug), $tab), sprintf(__('%s | Ultimate Member', $this->slug), $tab), 'manage_options', $this->slug . '-' . $k, array(&$this, 'admin_page') );
|
||||
|
||||
}
|
||||
|
||||
add_submenu_page( $this->slug, __('Dashboard', $this->slug), __('Dashboard', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page') );
|
||||
|
||||
@@ -1321,11 +1328,11 @@
|
||||
|
||||
add_submenu_page( $this->slug, __('Forms', $this->slug), __('Forms', $this->slug), 'manage_options', 'edit.php?post_type=um_form', '', '' );
|
||||
|
||||
add_submenu_page( $this->slug, __('Roles', $this->slug), __('Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' );
|
||||
add_submenu_page( $this->slug, __('Member Levels', $this->slug), __('Member Levels', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' );
|
||||
|
||||
add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' );
|
||||
|
||||
add_submenu_page( $this->slug, __('Members', $this->slug), __('Members', $this->slug), 'manage_options', 'users.php', '', '' );
|
||||
|
||||
add_submenu_page( $this->slug, __('Directories', $this->slug), __('Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' );
|
||||
|
||||
} else {
|
||||
$this->page = add_menu_page(
|
||||
@@ -4311,11 +4318,26 @@
|
||||
|
||||
public function admin_page(){
|
||||
|
||||
$um_admin = new UM_Admin_API();
|
||||
|
||||
$page = $_REQUEST['page'];
|
||||
|
||||
if ( $page == 'ultimatemember')
|
||||
|
||||
if ( $page == 'ultimatemember' ) {
|
||||
include_once um_path . 'admin/templates/dashboard.php';
|
||||
}
|
||||
|
||||
if ( strstr( $page, 'ultimatemember-' ) ) {
|
||||
|
||||
$template = str_replace('ultimatemember-','',$page);
|
||||
$file = um_path . 'admin/templates/'. $template . '.php';
|
||||
|
||||
if ( file_exists( $file ) ){
|
||||
include_once um_path . 'admin/templates/'. $template . '.php';
|
||||
} else {
|
||||
echo '<h4>' . __('Please create a team.php template in admin templates.','ultimatemember') . '</h4>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ class UM_Admin_Columns {
|
||||
$admin = new UM_Admin_Metabox();
|
||||
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['id'] = __('ID');
|
||||
$new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' );
|
||||
$new_columns['title'] = __('Title');
|
||||
$new_columns['mode'] = __('Type');
|
||||
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Copy this shortcode to any post/page to display the relevant form' );
|
||||
$new_columns['mode'] = __('Type') . $admin->_tooltip( 'This is the type of the form' );
|
||||
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the form' );
|
||||
$new_columns['impressions'] = __('Impressions') . $admin->_tooltip( 'The total number of times this form has been viewed' );
|
||||
$new_columns['conversions'] = __('Conversions') . $admin->_tooltip( 'The total number of conversions. e.g. Successful sign-ups' );
|
||||
$new_columns['date'] = __('Date');
|
||||
@@ -33,6 +33,23 @@ class UM_Admin_Columns {
|
||||
return $new_columns;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Custom columns for Directory
|
||||
***/
|
||||
function manage_edit_um_directory_columns($columns) {
|
||||
|
||||
$admin = new UM_Admin_Metabox();
|
||||
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' );
|
||||
$new_columns['title'] = __('Title');
|
||||
$new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the member directory' );
|
||||
$new_columns['date'] = __('Date');
|
||||
|
||||
return $new_columns;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Display cusom columns for Form
|
||||
@@ -75,18 +92,6 @@ class UM_Admin_Columns {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Custom columns for Directory
|
||||
***/
|
||||
function manage_edit_um_directory_columns($columns) {
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['id'] = __('ID');
|
||||
$new_columns['title'] = __('Title');
|
||||
$new_columns['shortcode'] = __('Shortcode');
|
||||
$new_columns['date'] = __('Date');
|
||||
return $new_columns;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Display cusom columns for Directory
|
||||
|
||||
@@ -12,10 +12,25 @@ class UM_Admin_Enqueue {
|
||||
|
||||
add_filter('admin_body_class', array(&$this, 'admin_body_class'), 9 );
|
||||
|
||||
add_filter( 'enter_title_here', array(&$this, 'enter_title_here') );
|
||||
add_filter('enter_title_here', array(&$this, 'enter_title_here') );
|
||||
|
||||
add_filter('admin_footer_text', array(&$this, 'admin_footer_text') );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Show footer text
|
||||
***/
|
||||
function admin_footer_text() {
|
||||
$copyright = sprintf(__('Thank you for creating with <a href="http://ultimatemember.com">Ultimate Member</a> and <a href="https://wordpress.org">WordPress</a>.','ultimatemember'));
|
||||
|
||||
if ( um_get_option('admin_load_time') == 1 ) {
|
||||
$copyright .= '<br />' . sprintf(__('%1$s queries made in %2$s seconds','ultimatemember'), get_num_queries(), timer_stop(0) );
|
||||
}
|
||||
|
||||
return '<span id="footer-thankyou">' . $copyright . '</span>';
|
||||
}
|
||||
|
||||
/***
|
||||
*** @enter title placeholder
|
||||
***/
|
||||
@@ -42,8 +57,8 @@ class UM_Admin_Enqueue {
|
||||
|
||||
if ( strstr($screen_id, 'um_form') ) $highlighted_id = 3;
|
||||
if ( strstr($screen_id, 'um_role') ) $highlighted_id = 4;
|
||||
if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 6;
|
||||
if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 5;
|
||||
if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 5;
|
||||
if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 6;
|
||||
|
||||
if ( isset($highlighted_id) ) { ?>
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@ class UM_Admin_Notices {
|
||||
function __construct() {
|
||||
|
||||
add_action('admin_notices', array(&$this, 'admin_notices'));
|
||||
|
||||
add_action('admin_notices', array(&$this, 'um_admin_notices'));
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -47,21 +44,4 @@ class UM_Admin_Notices {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @For custom-styled notices
|
||||
***/
|
||||
function um_admin_notices() {
|
||||
|
||||
$notices = get_option('um_admin_notices');
|
||||
if ( $notices ) {
|
||||
|
||||
foreach($notices as $notice){
|
||||
echo "<div class='um-admin-notice'>
|
||||
<div>$notice</div>
|
||||
</div>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
'google_api_key' => '', // Must be defined to add google fonts to the typography module
|
||||
'async_typography' => true, // Use a asynchronous font on the front end or font string
|
||||
'admin_bar' => true, // Show the panel pages on the admin bar
|
||||
'admin_bar' => false, // Show the panel pages on the admin bar
|
||||
'global_variable' => '', // Set a different name for your global variable other than the opt_name
|
||||
'dev_mode' => false, // Show the time the page took to load, etc
|
||||
'customizer' => false, // Enable basic customizer support
|
||||
|
||||
Reference in New Issue
Block a user