diff --git a/includes/admin/class-admin-functions.php b/includes/admin/class-admin-functions.php index b52a3441..f5e4ef1b 100644 --- a/includes/admin/class-admin-functions.php +++ b/includes/admin/class-admin-functions.php @@ -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; diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index 4d39cd1d..f88469e7 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -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(); diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php index 4a76b930..2e7abdf9 100644 --- a/includes/admin/core/class-admin-metabox.php +++ b/includes/admin/core/class-admin-metabox.php @@ -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; } diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php index 2b400c7d..7958e4a3 100644 --- a/includes/class-dependencies.php +++ b/includes/class-dependencies.php @@ -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',