mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-13 19:56:27 +09:00
- settings optimization;
This commit is contained in:
@@ -6,58 +6,59 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'Admin' ) ) {
|
||||
|
||||
class Admin {
|
||||
var $templates_path;
|
||||
class Admin {
|
||||
var $templates_path;
|
||||
|
||||
function __construct() {
|
||||
$this->templates_path = um_path . 'includes/admin/templates/';
|
||||
/**
|
||||
* Admin constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->templates_path = um_path . 'includes/admin/templates/';
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'admin_init' ), 0 );
|
||||
add_action( 'admin_init', array( &$this, 'admin_init' ), 0 );
|
||||
|
||||
add_action( 'admin_notices', array( $this, 'check_wrong_install_folder' ), 3 );
|
||||
|
||||
}
|
||||
add_action( 'admin_notices', array( $this, 'check_wrong_install_folder' ), 3 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if plugin is installed with correct folder
|
||||
*/
|
||||
function check_wrong_install_folder() {
|
||||
$invalid_folder = false;
|
||||
|
||||
function check_wrong_install_folder() {
|
||||
$invalid_folder = false;
|
||||
$slug_array = explode( '/', um_plugin );
|
||||
if ( $slug_array[0] != 'ultimate-member' )
|
||||
$invalid_folder = true;
|
||||
|
||||
$slug_array = explode( '/', um_plugin );
|
||||
if ( $slug_array[0] != 'ultimate-member' )
|
||||
$invalid_folder = true;
|
||||
if ( $invalid_folder ) { ?>
|
||||
|
||||
if ( $invalid_folder ) { ?>
|
||||
<div class="error">
|
||||
<p>
|
||||
<?php printf( __( 'You have installed <strong>%s</strong> with wrong folder name. Correct folder name is <strong>"ultimate-member"</strong>.', 'ultimate-member' ), ultimatemember_plugin_name ) ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="error">
|
||||
<p>
|
||||
<?php printf( __( 'You have installed <strong>%s</strong> with wrong folder name. Correct folder name is <strong>"ultimate-member"</strong>.', 'ultimate-member' ), ultimatemember_plugin_name ) ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
}
|
||||
<?php }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init admin action/filters + request handlers
|
||||
*/
|
||||
function admin_init() {
|
||||
require_once 'core/um-admin-actions-user.php';
|
||||
require_once 'core/um-admin-actions-modal.php';
|
||||
require_once 'core/um-admin-actions.php';
|
||||
|
||||
/**
|
||||
* Init admin action/filters + request handlers
|
||||
*/
|
||||
function admin_init() {
|
||||
require_once 'core/um-admin-actions-user.php';
|
||||
require_once 'core/um-admin-actions-modal.php';
|
||||
require_once 'core/um-admin-actions.php';
|
||||
require_once 'core/um-admin-filters-fields.php';
|
||||
|
||||
require_once 'core/um-admin-filters-fields.php';
|
||||
|
||||
if ( is_admin() && current_user_can('manage_options') &&
|
||||
! empty( $_REQUEST['um_adm_action'] ) ) {
|
||||
do_action( "um_admin_do_action__", $_REQUEST['um_adm_action'] );
|
||||
do_action( "um_admin_do_action__{$_REQUEST['um_adm_action']}", $_REQUEST['um_adm_action'] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if ( is_admin() && current_user_can('manage_options') &&
|
||||
! empty( $_REQUEST['um_adm_action'] ) ) {
|
||||
do_action( "um_admin_do_action__", $_REQUEST['um_adm_action'] );
|
||||
do_action( "um_admin_do_action__{$_REQUEST['um_adm_action']}", $_REQUEST['um_adm_action'] );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user