Plugin: Deprecate gutenberg_can_edit_* functions#13470
Merged
youknowriad merged 1 commit intomasterfrom Feb 14, 2019
Merged
Conversation
0b65b9c to
35db60e
Compare
35db60e to
c84e4e2
Compare
c84e4e2 to
8e33fd6
Compare
jorgefilipecosta
approved these changes
Feb 13, 2019
Member
There was a problem hiding this comment.
LGTM 👍
I verified that for this CPT:
function create_product_type() {
register_post_type( 'acme_product',
array(
'label' => 'Product',
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'show_in_rest' => true,
'supports' => array( 'title' ),
)
);
}
add_action( 'init', 'create_product_type' );
The editor is not loaded, and classic editor opens with just the title field (as before).
If we replace title with editor the editor loads without the option to choose the title.
If we remove the supports array the editor loads normally if we set show_in_rest to false the classic editor starts being used instead.
I also did some grepping and I verified that there are no usages of the deprecated functions.
This was referenced Feb 18, 2019
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
youknowriad
pushed a commit
that referenced
this pull request
Mar 6, 2019
This was referenced Apr 30, 2020
This was referenced Apr 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #11015
This pull request seeks to deprecate the
gutenberg_can_edit_post_typeandgutenberg_can_edit_postfunctions in favor of the core-equivalentuse_block_editor_for_post_typeanduse_block_editor_for_postfunctions.See:
Testing instructions:
Verify that one can edit a Gutenberg post if and only if the post type and user are capable of editing (e.g.
show_in_rest, supportseditor, etc). The logic is not identical in core, and this will continue to be aligned until eventually Gutenberg merely extends theedit-form-blocks.phpinterface.The core implementations also use the
meta-box-loaderquery parameter for meta boxes, which is not the same as what's used in Gutenberg. However, this is already slated for removal as of #13449.