PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 3.1.5
Jetpack – WP Security, Backup, Speed, & Growth v3.1.5
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / json-api.php

json-api.php in Jetpack – WP Security, Backup, Speed, & Growth 3.1.5, at modules/json-api.php

48 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: JSON API
4 * Module Description: Allow applications to securely access your content through the cloud.
5 * Sort Order: 19
6 * First Introduced: 1.9
7 * Requires Connection: Yes
8 * Auto Activate: Public
9 * Module Tags: Writing, Developers
10 */
11
12 add_action( 'jetpack_activate_module_json-api', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
13 add_action( 'jetpack_deactivate_module_json-api', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
14
15 add_action( 'jetpack_modules_loaded', 'jetpack_json_api_load_module' );
16
17 function jetpack_json_api_load_module() {
18 Jetpack::enable_module_configurable( __FILE__ );
19 Jetpack::module_configuration_load( __FILE__, 'jetpack_json_api_configuration_load' );
20 Jetpack::module_configuration_screen( __FILE__, 'jetpack_json_api_configuration_screen' );
21 }
22
23 function jetpack_json_api_configuration_load() {
24 if ( isset( $_POST['action'] ) && $_POST['action'] == 'save_options' && wp_verify_nonce( $_POST['_wpnonce'], 'json-api' ) ) {
25 Jetpack_Options::update_option( 'json_api_full_management', isset( $_POST['json_api_full_management'] ) );
26 Jetpack::state( 'message', 'module_configured' );
27 wp_safe_redirect( Jetpack::module_configuration_url( 'json-api' ) );
28 exit;
29 }
30 }
31
32 function jetpack_json_api_configuration_screen() {
33 ?>
34 <div class="narrow">
35 <form method="post">
36 <input type='hidden' name='action' value='save_options' />
37 <?php wp_nonce_field( 'json-api' ); ?>
38 <table id="menu" class="form-table">
39 <tr valign="top"><th scope="row"><label for="json_api_full_management"><?php _e( 'Allow management' , 'jetpack' ); ?></label></th>
40 <td><label><input type='checkbox'<?php checked( Jetpack_Options::get_option( 'json_api_full_management' ) ); ?> name='json_api_full_management' id='json_api_full_management' /> <?php printf( __( 'Allow remote management of themes, plugins, and WordPress via the JSON API. (<a href="%s" title="Learn more about JSON API">More info</a>).', 'jetpack') , '//jetpack.me/support/json-api' ); ?></label></td></tr>
41
42 </table>
43 <p class="submit"><input type='submit' class='button-primary' value='<?php echo esc_attr( __( 'Save configuration', 'jetpack' ) ); ?>' /></p>
44 </form>
45 </div>
46 <?php
47 }
48