json-endpoints/jetpack/class.jetpack-json-api-modules-modify-endpoint.php 1 location
|
@@ 11-22 (lines=12) @@
|
8 |
|
protected $needed_capabilities = 'activate_plugins'; |
9 |
|
protected $action = 'default_action'; |
10 |
|
|
11 |
|
public function default_action() { |
12 |
|
$args = $this->input(); |
13 |
|
if ( isset( $args['active'] ) && is_bool( $args['active'] ) ) { |
14 |
|
if ( $args['active'] ) { |
15 |
|
return $this->activate_module(); |
16 |
|
} else { |
17 |
|
return $this->deactivate_module(); |
18 |
|
} |
19 |
|
} |
20 |
|
|
21 |
|
return true; |
22 |
|
} |
23 |
|
|
24 |
|
protected function activate_module() { |
25 |
|
foreach ( $this->modules as $module ) { |
json-endpoints/jetpack/class.jetpack-json-api-themes-modify-endpoint.php 1 location
|
@@ 11-22 (lines=12) @@
|
8 |
|
protected $action = 'default_action'; |
9 |
|
protected $expected_actions = array( 'update' ); |
10 |
|
|
11 |
|
public function default_action() { |
12 |
|
$args = $this->input(); |
13 |
|
if ( isset( $args['autoupdate'] ) && is_bool( $args['autoupdate'] ) ) { |
14 |
|
if ( $args['autoupdate'] ) { |
15 |
|
$this->autoupdate_on(); |
16 |
|
} else { |
17 |
|
$this->autoupdate_off(); |
18 |
|
} |
19 |
|
} |
20 |
|
|
21 |
|
return true; |
22 |
|
} |
23 |
|
|
24 |
|
function autoupdate_on() { |
25 |
|
$autoupdate_themes = Jetpack_Options::get_option( 'autoupdate_themes', array() ); |