Skip to content

Backport themes is_block_theme collection param from core#53846

Merged
ntsekouras merged 2 commits intotrunkfrom
backport/is_block_theme-collection-param
Aug 21, 2023
Merged

Backport themes is_block_theme collection param from core#53846
ntsekouras merged 2 commits intotrunkfrom
backport/is_block_theme-collection-param

Conversation

@ntsekouras
Copy link
Copy Markdown
Contributor

@ntsekouras ntsekouras commented Aug 21, 2023

What?

Currently for the command packages we are using the is_block_theme theme's collection param to handle some callbacks conditionally. This param though was introduced directly in core here for 6.3 and since in GB we support one more WP version, we need to add it in GB too, under compat/6.3 files.

This PR does that.

Testing Instructions

Have WP 6.2 installed.

  1. You can test different handling of commands based on this param
  2. Example would be the redirection to site editor or post editor from this PR from the commands. Enable a block theme and through the commands select a different page.
  3. It should redirect you to the site editor.

Alternatively of course you can just test the response of a rest client, when requesting themes.

@ntsekouras ntsekouras added the Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core label Aug 21, 2023
@ntsekouras ntsekouras self-assigned this Aug 21, 2023
@github-actions
Copy link
Copy Markdown

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.3/rest-api.php

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I have activated the block theme in WordPress 6.2 and tested the following:

  • trunk:
    • wp.data.select('core').getCurrentTheme().is_block_theme > undefined
    • Commands that should be available when in a block theme are not displayed (Navigation, Styles, Pages, Templates, etc.)
  • This PR:
    • wp.data.select('core').getCurrentTheme().is_block_theme > true
    • ✅ Commands that should be available when in a block theme are displayed as expected.

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
@ntsekouras ntsekouras merged commit 13bcad8 into trunk Aug 21, 2023
@ntsekouras ntsekouras deleted the backport/is_block_theme-collection-param branch August 21, 2023 14:52
@github-actions github-actions bot added this to the Gutenberg 16.6 milestone Aug 21, 2023
@vcanales vcanales added the Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants