Add new option to disable profile object caching

This commit is contained in:
champsupertramp
2016-04-11 14:00:59 +08:00
parent 692baa33f3
commit b2ad5c840e
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -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 ) {
+10
View File
@@ -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',