Repository navigation
Keep synced patterns (wp_block) out of supported post types - #1481
Open
faisalahammad wants to merge 1 commit into
Open
faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
WordPress trunk (7.2-alpha, changeset 64499, core ticket #66307) added 'author' support to the wp_block post type. supported_post_types() picks every post type that supports 'author', so wp_block was now treated as a co-authors post type. This registered the author taxonomy on patterns, removed the core author control from the pattern REST response, and made the SupportedPostTypesTest tests fail on WP trunk. Add wp_block to the list of excluded built-in post types, so the behaviour is the same as on older WordPress. Sites that want co-authors on patterns can still add it with the coauthors_supported_post_types filter. Add a test that adds 'author' support to wp_block, so it covers stable WP versions too.
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.
Description
WordPress trunk (7.2-alpha) added
authorsupport to the corewp_blockpost type in changeset 64499 (https://core.trac.wordpress.org/ticket/66307, WordPress/wordpress-develop@1f935706e9, synced from WordPress/gutenberg#84680).CoAuthors_Plus::supported_post_types()picks every post type that supportsauthor, so on trunk it now returnspost, page, wp_block. Because of this:remove_author_link()removes the new core author control from the pattern REST response,SupportedPostTypesTest::test_default_supported_post_typesandtest_can_filter_supported_post_typesfail in the "WP master on PHP latest" CI job.The plugin already skips
wp_blockin the co-authors REST endpoint (request_is_for_wp_block_post_type(),is_pattern_sync_operation()), so co-authors were never meant for patterns. This PR addswp_blockto$excluded_built_in, so behaviour is the same as on older WordPress. Sites that want it can still addwp_blockwith thecoauthors_supported_post_typesfilter.A new test adds
authorsupport towp_blockbefore the check, so it covers stable WordPress too.Deploy Notes
None.
Steps to Test
composer test:integration(or the integration suite in wp-env) on WP stable: all SupportedPostTypesTest tests pass.test_default_supported_post_typesandtest_can_filter_supported_post_typespass again.Verified locally: SupportedPostTypesTest 7/7 OK on WP 7.1.3 (new test fails without the fix). Full integration suite: 387 tests, only the 2
ms-requiredmultisite tests error, same as on develop in single-site mode. PHPCS: test file clean; class-coauthors-plus.php has 207 existing errors, 208 before (no new ones).