mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed is_admin_screen function;
This commit is contained in:
@@ -25,10 +25,9 @@ if ( ! class_exists( 'um\admin\Admin_Functions' ) ) {
|
||||
/**
|
||||
* Boolean check if we're viewing UM backend
|
||||
*
|
||||
* @todo global for all admin classes
|
||||
* @return bool
|
||||
*/
|
||||
function is_UM_admin_screen() {
|
||||
function is_um_screen() {
|
||||
global $current_screen;
|
||||
$screen_id = $current_screen->id;
|
||||
|
||||
|
||||
@@ -12,7 +12,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_Enqueue {
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $js_url;
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $css_url;
|
||||
|
||||
|
||||
@@ -355,27 +365,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Boolean check if we're viewing UM backend
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_UM_admin() {
|
||||
global $current_screen;
|
||||
|
||||
$screen_id = $current_screen->id;
|
||||
if ( strstr( $screen_id, 'ultimatemember' ) || strstr( $screen_id, 'um_' ) || strstr( $screen_id, 'user' ) || strstr( $screen_id, 'profile' ) || $screen_id == 'nav-menus' ) return true;
|
||||
|
||||
global $post;
|
||||
if ( isset( $post->post_type ) ) return true;
|
||||
|
||||
global $tax;
|
||||
if ( isset( $tax->name ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds class to our admin pages
|
||||
*
|
||||
@@ -384,7 +373,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
* @return string
|
||||
*/
|
||||
function admin_body_class( $classes ) {
|
||||
if ( $this->is_UM_admin() ) {
|
||||
if ( UM()->admin()->is_um_screen() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
@@ -395,7 +384,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
function admin_enqueue_scripts() {
|
||||
if ( $this->is_UM_admin() ) {
|
||||
if ( UM()->admin()->is_um_screen() ) {
|
||||
|
||||
/*if ( get_post_type() != 'shop_order' ) {
|
||||
UM()->enqueue()->wp_enqueue_scripts();
|
||||
|
||||
@@ -120,20 +120,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Boolean check if we're viewing UM backend
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_UM_admin() {
|
||||
global $current_screen;
|
||||
$screen_id = $current_screen->id;
|
||||
if ( is_admin() && ( strstr( $screen_id, 'ultimatemember') || strstr( $screen_id, 'um_') || strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the role meta
|
||||
*
|
||||
@@ -1149,7 +1135,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
function load_modal_content() {
|
||||
|
||||
$screen = get_current_screen();
|
||||
if ( $this->is_UM_admin() ) {
|
||||
if ( UM()->admin()->is_um_screen() ) {
|
||||
foreach ( glob( um_path . 'includes/admin/templates/modal/*.php' ) as $modal_content ) {
|
||||
include_once $modal_content;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
|
||||
'private-content' => '2.0',
|
||||
'profile-completeness' => '2.0.1',
|
||||
'recaptcha' => '2.0',
|
||||
'reviews' => '2.0.2',
|
||||
'reviews' => '2.0.3',
|
||||
'social-activity' => '2.0.1',
|
||||
'social-login' => '2.0.1',
|
||||
'terms-conditions' => '2.0',
|
||||
|
||||
Reference in New Issue
Block a user