Plugin Directory

Changeset 2362524


Ignore:
Timestamp:
08/16/2020 07:24:10 PM (6 years ago)
Author:
baseapp
Message:

Minor_update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wpbase-cache/trunk/wpbase-redis-cache.php

    r2361544 r2362524  
    250250    }
    251251
    252     public function do_admin_actions() {
    253 
    254         global $wp_filesystem;
    255         if ($_POST['wpbase_cache_options']['redis_cache'] == '1') {
    256             update_option('wpbase_cache_options', 'redis_cache', "1");
    257             $wp_filesystem->copy(plugin_dir_path(__FILE__) . '/includes/object-cache.php', WP_CONTENT_DIR . '/object-cache.php', true);
    258             //do_action( 'redis_object_cache_enable', $result );
    259         } else if ($_POST['wpbase_cache_options']['redis_cache'] == NULL || $_POST['wpbase_cache_options']['redis_cache'] == '0') {
    260             update_option('wpbase_cache_options', 'redis_cache', '0');
    261             $wp_filesystem->delete(WP_CONTENT_DIR . '/object-cache.php');
    262             //do_action( 'redis_object_cache_disable', $result );
    263         }
    264     }
    265 
     252    public function do_admin_actions() {
     253
     254            global $wp_filesystem;
     255            if ( $this->initialize_filesystem( $url, true ) ) {
     256
     257                if ($_POST['wpbase_cache_options']['redis_cache'] == '1') {
     258                        update_option('wpbase_cache_options', 'redis_cache', "1");
     259                        $wp_filesystem->copy(plugin_dir_path(__FILE__) . '/includes/object-cache.php', WP_CONTENT_DIR . '/object-cache.php', true);
     260                        do_action( 'redis_object_cache_enable', $result );
     261                } else if ($_POST['wpbase_cache_options']['redis_cache'] == NULL || $_POST['wpbase_cache_options']['redis_cache'] == '0') {
     262                        update_option('wpbase_cache_options', 'redis_cache', '0');
     263                        $wp_filesystem->delete(WP_CONTENT_DIR . '/object-cache.php');
     264                        do_action( 'redis_object_cache_disable', $result );
     265                }
     266            }
     267       }
    266268    public function initialize_filesystem( $url, $silent = false ) {
    267269
Note: See TracChangeset for help on using the changeset viewer.