From 95d244b2f3e1b4bd56770601ced9616eecaff974 Mon Sep 17 00:00:00 2001 From: ultimatemember Date: Wed, 14 Jan 2015 00:16:44 +0200 Subject: [PATCH] Revert to stable version --- .../lib/ReduxFramework/ReduxCore/framework.php | 2 +- core/um-cache.php | 18 ++++++++++++++++++ core/um-short-functions.php | 18 ++++++++++++++++++ core/um-taxonomies.php | 2 +- um-init.php | 2 ++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 core/um-cache.php diff --git a/admin/core/lib/ReduxFramework/ReduxCore/framework.php b/admin/core/lib/ReduxFramework/ReduxCore/framework.php index 3aed7790..afa2b330 100644 --- a/admin/core/lib/ReduxFramework/ReduxCore/framework.php +++ b/admin/core/lib/ReduxFramework/ReduxCore/framework.php @@ -1329,7 +1329,7 @@ add_submenu_page( $this->slug, __('User Roles', $this->slug), __('User Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' ); - if ( um_get_option('members_page' ) ){ + if ( um_get_option('members_page' ) || !get_option('um_options') ){ add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' ); } diff --git a/core/um-cache.php b/core/um-cache.php new file mode 100644 index 00000000..8695c253 --- /dev/null +++ b/core/um-cache.php @@ -0,0 +1,18 @@ +permalinks->core; + $current_url = trailingslashit( $ultimatemember->permalinks->get_current_url(true) ); + + if ( !isset( $array ) || !is_array( $array ) ) return false; + + foreach( $array as $k => $id ) { + $page_url = trailingslashit( get_permalink( $id ) ); + if ( strstr( $current_url, $page_url ) ) + return true; + } + return false; + } + /*** *** @Check value of queried search in text input ***/ diff --git a/core/um-taxonomies.php b/core/um-taxonomies.php index 59d1187e..ce49acfa 100644 --- a/core/um-taxonomies.php +++ b/core/um-taxonomies.php @@ -49,7 +49,7 @@ class UM_Taxonomies { ) ); - if ( um_get_option('members_page') ){ + if ( um_get_option('members_page') || !get_option('um_options') ){ register_post_type( 'um_directory', array( 'labels' => array( diff --git a/um-init.php b/um-init.php index 21a05614..f6c3f6ea 100644 --- a/um-init.php +++ b/um-init.php @@ -53,6 +53,7 @@ class UM_API { require_once um_path . 'core/um-logout.php'; require_once um_path . 'core/um-modal.php'; require_once um_path . 'core/um-cron.php'; + require_once um_path . 'core/um-cache.php'; require_once um_path . 'core/lib/mobiledetect/Mobile_Detect.php'; @@ -116,6 +117,7 @@ class UM_API { $this->logout = new UM_Logout(); $this->modal = new UM_Modal(); $this->cron = new UM_Cron(); + $this->cache = new UM_Cache(); $this->mobile = new Mobile_Detect;