public function callback($path = '', $blog_id = 0, $object = null)
 {
     Jetpack_JSON_API_Endpoint::validate_input($object);
     switch ($this->action) {
         case 'update':
             $this->needed_capabilities = 'update_plugins';
             break;
         case 'install':
             $this->needed_capabilities = 'install_plugins';
             break;
     }
     if (isset($args['autoupdate'])) {
         $this->needed_capabilities = 'update_plugins';
     }
     return parent::callback($path, $blog_id, $object);
 }
コード例 #2
0
 public function callback($path = '', $blog_id = 0, $plugin = null)
 {
     $args = $this->input();
     if (isset($args['active'])) {
         $this->action = $args['active'] ? 'activate_plugin' : 'deactivate_plugin';
     }
     return parent::callback($path, $blog_id, $plugin);
 }