/**
  * Overwrites the set_upgrader to be able to tell if we e ven have the ability to write to the files.
  *
  * @param WP_Upgrader $upgrader
  *
  */
 public function set_upgrader(&$upgrader)
 {
     parent::set_upgrader($upgrader);
     // Check if we even have permission to.
     $result = $upgrader->fs_connect(array(WP_CONTENT_DIR, WP_PLUGIN_DIR));
     if (!$result) {
         // set the string here since they are not available just yet
         $upgrader->generic_strings();
         $this->feedback('fs_unavailable');
     }
 }
Пример #2
0
 /**
  * Initialize the upgrader.
  *
  * This will set the relationship between the skin being used and this upgrader,
  * and also add the generic strings to `WP_Upgrader::$strings`.
  *
  * @since 2.8.0
  * @access public
  */
 public function init()
 {
     $this->skin->set_upgrader($this);
     $this->generic_strings();
 }