From d6fd4b26bbe09bd334eaae1ef7de3f55d2525f1d Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 25 Feb 2019 11:20:55 -0500 Subject: [PATCH 1/2] Plugin: Fix 5.1.0 deprecated functions to correct plugin version --- lib/register.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/register.php b/lib/register.php index 16d5aa85b623e0..635c77eaf8c91d 100644 --- a/lib/register.php +++ b/lib/register.php @@ -25,16 +25,15 @@ function gutenberg_collect_meta_box_data() { * Return whether the post can be edited in Gutenberg and by the current user. * * @since 0.5.0 - * @deprecated 5.0.0 use_block_editor_for_post + * @deprecated 5.1.0 use_block_editor_for_post * * @param int|WP_Post $post Post ID or WP_Post object. * @return bool Whether the post can be edited with Gutenberg. */ function gutenberg_can_edit_post( $post ) { - _deprecated_function( __FUNCTION__, '5.0.0', 'use_block_editor_for_post' ); + _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post' ); return use_block_editor_for_post( $post ); - } /** @@ -44,13 +43,13 @@ function gutenberg_can_edit_post( $post ) { * REST API, then the post cannot be edited in Gutenberg. * * @since 1.5.2 - * @deprecated 5.0.0 use_block_editor_for_post_type + * @deprecated 5.1.0 use_block_editor_for_post_type * * @param string $post_type The post type. * @return bool Whether the post type can be edited with Gutenberg. */ function gutenberg_can_edit_post_type( $post_type ) { - _deprecated_function( __FUNCTION__, '5.0.0', 'use_block_editor_for_post_type' ); + _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post_type' ); return use_block_editor_for_post_type( $post_type ); } @@ -155,23 +154,23 @@ function gutenberg_bulk_post_updated_messages( $messages ) { * Injects a hidden input in the edit form to propagate the information that classic editor is selected. * * @since 1.5.2 - * @deprecated 5.0.0 + * @deprecated 5.1.0 */ function gutenberg_remember_classic_editor_when_saving_posts() { - _deprecated_function( __FUNCTION__, '5.0.0' ); + _deprecated_function( __FUNCTION__, '5.1.0' ); } /** * Appends a query argument to the redirect url to make sure it gets redirected to the classic editor. * * @since 1.5.2 - * @deprecated 5.0.0 + * @deprecated 5.1.0 * * @param string $url Redirect url. * @return string Redirect url. */ function gutenberg_redirect_to_classic_editor_when_saving_posts( $url ) { - _deprecated_function( __FUNCTION__, '5.0.0' ); + _deprecated_function( __FUNCTION__, '5.1.0' ); return $url; } @@ -181,13 +180,13 @@ function gutenberg_redirect_to_classic_editor_when_saving_posts( $url ) { * the editor from which the user navigated. * * @since 1.5.2 - * @deprecated 5.0.0 + * @deprecated 5.1.0 * * @param string $url Edit url. * @return string Edit url. */ function gutenberg_revisions_link_to_editor( $url ) { - _deprecated_function( __FUNCTION__, '5.0.0' ); + _deprecated_function( __FUNCTION__, '5.1.0' ); return $url; } From fca1257af4ae2eb734a5aa4a0e9867a3761f9914 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 25 Feb 2019 14:32:24 -0500 Subject: [PATCH 2/2] Plugin: Require includes for deprecated `use_block_editor_for_` functions --- lib/register.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/register.php b/lib/register.php index 635c77eaf8c91d..9f86fdb58200b8 100644 --- a/lib/register.php +++ b/lib/register.php @@ -33,6 +33,7 @@ function gutenberg_collect_meta_box_data() { function gutenberg_can_edit_post( $post ) { _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post' ); + require_once ABSPATH . 'wp-admin/includes/post.php'; return use_block_editor_for_post( $post ); } @@ -51,6 +52,7 @@ function gutenberg_can_edit_post( $post ) { function gutenberg_can_edit_post_type( $post_type ) { _deprecated_function( __FUNCTION__, '5.1.0', 'use_block_editor_for_post_type' ); + require_once ABSPATH . 'wp-admin/includes/post.php'; return use_block_editor_for_post_type( $post_type ); }