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

Editor: Use visibility selector for PostTemplatePanel #57224

Merged

Conversation

yuliyan
Copy link
Contributor

@yuliyan yuliyan commented Dec 19, 2023

What?

#56817 (likely unintentionally) introduced a hardcoded visibility flag for the PostTemplatePanel, causing it to be always visible on non-block themes for all post types.

How?

Assign the useSelect() call to the isVisible variable.

Testing Instructions

  1. Using a non-block theme (for example, twentyfourteen), open the block editor for a post type that's not expected to allow setting a page template, e.g. post.
  2. Confirm the PostTemplatePanel is visible.
  3. Apply the changes from this PR and repeat the steps.
  4. Confirm the PostTemplatePanel is only visible when expected to - e.g. it should be visible for page, and not visible for post.

@tyxla tyxla added [Type] Bug An existing feature does not function as intended [Package] Editor /packages/editor labels Dec 19, 2023
@tyxla tyxla requested review from a team and mcsf and removed request for a team December 19, 2023 15:53
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

@yuliyan
Copy link
Contributor Author

yuliyan commented Dec 19, 2023

Thank you for the review, @ciampo!

I'm not authorized to merge PRs, so I suppose someone should do that for me, correct?

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Looks good 🚀

I'll go ahead and 🚢 this one

@tyxla tyxla merged commit 85f8b26 into WordPress:trunk Dec 19, 2023
55 of 56 checks passed
@github-actions github-actions bot added this to the Gutenberg 17.4 milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants