protected function validate_call($_blog_id, $capability, $check_manage_active = true) { $validate = parent::validate_call($_blog_id, $capability, $check_manage_active); if (is_wp_error($validate)) { // Lets delete the attachment... if the user doesn't have the right permissions to do things. $args = $this->input(); if (isset($args['zip'][0]['id'])) { wp_delete_attachment($args['zip'][0]['id'], true); } } return $validate; }
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); }
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); }