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

REST API: Limit default templates and template part areas data access via index #69346

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

Mamaduka
Copy link
Member

What?

The PR limits access to the default_template_part_areas and default_template_types values. They are now only available to logged-in users.

Why?

See https://core.trac.wordpress.org/ticket/62574#comment:16.

Testing Instructions

  1. Open a post.
  2. Confirm that the default_template_part_areas and default_template_types values are returned when you run the base entity data selector. Selector - wp.data.select( 'core' ).getUnstableBase();.
  3. Open an incognito window.
  4. Visit the test URL below (replace the domain with your local site).
  5. Confirm that values are no longer provided in the REST response.
https://gutenberg.test/wp-json/?_fields=description%2Cgmt_offset%2Chome%2Cname%2Csite_icon%2Csite_icon_url%2Csite_logo%2Ctimezone_string%2Cdefault_template_part_areas%2Cdefault_template_types%2Curl%2Cpage_for_posts%2Cpage_on_front%2Cshow_on_front&_locale=user

Testing Instructions for Keyboard

Same.

Screenshot

CleanShot 2025-02-27 at 11 42 33

CleanShot 2025-02-27 at 11 48 06

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant