diff options
Diffstat (limited to 'plugins/jetpack/class.jetpack-options.php')
-rw-r--r-- | plugins/jetpack/class.jetpack-options.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/plugins/jetpack/class.jetpack-options.php b/plugins/jetpack/class.jetpack-options.php index 7562109d..f9bd7143 100644 --- a/plugins/jetpack/class.jetpack-options.php +++ b/plugins/jetpack/class.jetpack-options.php @@ -32,8 +32,11 @@ class Jetpack_Options { 'site_icon_url', // (string) url to the full site icon 'site_icon_id', // (int) Attachment id of the site icon file 'dismissed_manage_banner', // (bool) Dismiss Jetpack manage banner allows the user to dismiss the banner permanently - 'updates', // (array) information about available updates to plugins, theme, WordPress core, and if site is under version control + 'restapi_stats_cache', // (array) Stats Cache data. + 'unique_connection', // (array) A flag to determine a unique connection to wordpress.com two values "connected" and "disconnected" with values for how many times each has occured + 'protect_whitelist' // (array) IP Address for the Protect module to ignore ); + case 'private' : return array( 'register', @@ -60,7 +63,8 @@ class Jetpack_Options { 'last_heartbeat', // (int) The timestamp of the last heartbeat that fired. 'last_security_report', // (int) The timestamp of the last security report that was run. 'sync_bulk_reindexing', // (bool) If a bulk reindex is currently underway. - 'jumpstart' // (string) A flag for whether or not to show the Jump Start. Accepts: new_connection, jumpstart_activated, jetpack_action_taken, jumpstart_dismissed. + 'jumpstart', // (string) A flag for whether or not to show the Jump Start. Accepts: new_connection, jumpstart_activated, jetpack_action_taken, jumpstart_dismissed. + 'hide_jitm' // (array) A list of just in time messages that we should not show because they have been dismissed by the user ); } @@ -130,10 +134,26 @@ class Jetpack_Options { * * @param string $name Option name * @param mixed $value Option value + * @param string $autoload If not compact option, allows specifying whether to autoload or not. */ - public static function update_option( $name, $value ) { + public static function update_option( $name, $value, $autoload = null ) { + /** + * Fires before Jetpack updates a specific option. + * + * @since 3.0.0 + * + * @param str $name The name of the option being updated. + * @param mixed $value The new value of the option. + */ do_action( 'pre_update_jetpack_option_' . $name, $name, $value ); if ( self::is_valid( $name, 'non_compact' ) ) { + /** + * Allowing update_option to change autoload status only shipped in WordPress v4.2 + * @link https://github.com/WordPress/WordPress/commit/305cf8b95 + */ + if ( version_compare( $GLOBALS['wp_version'], '4.2', '>=' ) ) { + return update_option( "jetpack_$name", $value, $autoload ); + } return update_option( "jetpack_$name", $value ); } |