Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Require includes for deprecated use_block_editor_for_ functions #14096

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ 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' );

require_once ABSPATH . 'wp-admin/includes/post.php';
return use_block_editor_for_post( $post );

}

/**
Expand All @@ -44,14 +44,15 @@ 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' );

require_once ABSPATH . 'wp-admin/includes/post.php';
return use_block_editor_for_post_type( $post_type );
}

Expand Down Expand Up @@ -155,23 +156,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;
}
Expand All @@ -181,13 +182,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;
}
Expand Down