From b2ad5c840e28c9764cfed1e41dfbe9e15605cdd1 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Mon, 11 Apr 2016 14:00:59 +0800 Subject: [PATCH] Add new option to disable profile object caching --- core/um-user.php | 6 ++++++ um-config.php | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/core/um-user.php b/core/um-user.php index 86830aec..3968859e 100644 --- a/core/um-user.php +++ b/core/um-user.php @@ -116,6 +116,12 @@ class UM_User { } function get_cached_data( $user_id ) { + + $disallow_cache = get_option('um_profile_object_cache_stop'); + if( $disallow_cache ){ + return ''; + } + if ( is_numeric( $user_id ) && $user_id > 0 ) { $find_user = get_option("um_cache_userdata_{$user_id}"); if ( $find_user ) { diff --git a/um-config.php b/um-config.php index 1231ca26..8b37ffde 100644 --- a/um-config.php +++ b/um-config.php @@ -1934,6 +1934,16 @@ $this->sections[] = array( 'full_width' => true, ), + array( + 'id' => 'um_profile_object_cache_stop', + 'type' => 'switch', + 'title' => __( 'Stop caching user\'s profile data','ultimatemember' ), + 'default' => 0, + 'desc' => __('Turn off If you have performance issue.','ultimatemember'), + 'on' => __('On','ultimatemember'), + 'off' => __('Off','ultimatemember'), + ), + array( 'id' => 'um_flush_stop', 'type' => 'switch',