diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2017-01-03 19:27:21 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2017-01-03 19:27:21 -0500 |
commit | 8f0ed12d83c648763b1c538698bfa0b3005a88c3 (patch) | |
tree | 130ecb4629dc8a6f8563d93f0c01d12d7f7cccc8 /plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php | |
parent | Update plugin jetpack to 4.4.1 (diff) | |
download | blogs-gentoo-8f0ed12d83c648763b1c538698bfa0b3005a88c3.tar.gz blogs-gentoo-8f0ed12d83c648763b1c538698bfa0b3005a88c3.tar.bz2 blogs-gentoo-8f0ed12d83c648763b1c538698bfa0b3005a88c3.zip |
Update plugin jetpack to 4.4.2
Diffstat (limited to 'plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php')
-rw-r--r-- | plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php b/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php index bfb45938..f37c5bd8 100644 --- a/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php +++ b/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php @@ -41,10 +41,6 @@ abstract class Jetpack_Admin_Page { self::$block_page_rendering_for_idc = ( Jetpack::validate_sync_error_idc_option() && ! Jetpack_Options::get_option( 'safe_mode_confirmed' ) ); - - if ( ! self::$block_page_rendering_for_idc ) { - add_action( 'admin_enqueue_scripts', array( $this, 'additional_styles' ) ); - } } function add_actions() { @@ -71,6 +67,10 @@ abstract class Jetpack_Admin_Page { add_action( "admin_print_styles-$hook", array( $this, 'admin_styles' ) ); add_action( "admin_print_scripts-$hook", array( $this, 'admin_scripts' ) ); + if ( ! self::$block_page_rendering_for_idc ) { + add_action( "admin_print_styles-$hook", array( $this, 'additional_styles' ) ); + } + // Check if the site plan changed and deactivate modules accordingly. add_action( 'current_screen', array( $this, 'check_plan_deactivate_modules' ) ); @@ -136,12 +136,36 @@ abstract class Jetpack_Admin_Page { wp_style_add_data( 'jetpack-admin', 'suffix', $min ); } + /** + * Checks if WordPress version is too old to have REST API. + * + * @since 4.3 + * + * @return bool + */ function is_wp_version_too_old() { global $wp_version; return ( ! function_exists( 'rest_api_init' ) || version_compare( $wp_version, '4.4-z', '<=' ) ); } /** + * Checks if REST API is enabled. + * + * @since 4.4.2 + * + * @return bool + */ + function is_rest_api_enabled() { + return + /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ + apply_filters( 'rest_enabled', true ) && + /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ + apply_filters( 'rest_jsonp_enabled', true ) && + /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ + apply_filters( 'rest_authentication_errors', true ); + } + + /** * Checks the site plan and deactivates modules that were active but are no longer included in the plan. * * @since 4.4.0 |