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

Fix: Make useIsSupportedMetaField hook context aware #263

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

fabiankaegy
Copy link
Member

@fabiankaegy fabiankaegy commented Sep 19, 2023

Description of the Change

We currently check whether the currently edited post supports a meta key before actually rendering the content of the post meta component. This however means that it actually is incorrect for any post meta block used within a query or post picker block.

This PR fixes that and ensures that the check always uses the post based on the available post context.

How to test the Change

  • Place the Post Meta block inside a query block and see that is pulls in the correct info

Changelog Entry

Fixed - Make useIsSupportedMetaField hook context aware

Credits

Props @fabiankaegy

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@github-actions
Copy link

Size Change: +18 B (0%)

Total Size: 54.1 kB

Filename Size Change
dist/index.js 54.1 kB +18 B (0%)

compressed-size-action

@cypress
Copy link

cypress bot commented Sep 19, 2023

Passing run #642 ↗︎

0 6 0 0 Flakiness 0

Details:

fix post meta sample block to use post context
Project: 10up Block Components Commit: 94010d5571
Status: Passed Duration: 02:47 💡
Started: Sep 19, 2023 11:35 AM Ended: Sep 19, 2023 11:37 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

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

LGTM!

@fabiankaegy fabiankaegy merged commit 29aba18 into develop Sep 20, 2023
4 of 5 checks passed
@fabiankaegy fabiankaegy deleted the fix/make-has-supported-meta-value-context-aware branch September 20, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants