Opened 6 weeks ago
Closed 5 weeks ago
#66045 closed enhancement (fixed)
Expose privacy policy page through REST API
| Reported by: | oandregal | Owned by: | oandregal |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | REST API | Version: | trunk |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Change History (4)
This ticket was mentioned in PR #13399 on WordPress/wordpress-develop by @oandregal.
6 weeks ago
#1
- Keywords has-unit-tests added
@ntsekouras commented on PR #13399:
6 weeks ago
#2
Let's also include (if needed) this change in tests for multisite.
@oandregal commented on PR #13399:
6 weeks ago
#3
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Backport of https://github.com/WordPress/gutenberg/pull/82422.
Trac ticket https://core.trac.wordpress.org/ticket/66045#ticket
The page assigned in Settings > Privacy is stored in the
wp_page_for_privacy_policyoption, but the option is not registered withshow_in_rest, so the/wp/v2/settingsendpoint cannot report it. This registers it aspage_for_privacy_policy, alongsidepage_on_frontandpage_for_posts, so the editor can show a "Privacy Policy Page" badge next to that page, as the classic pages list does.Changes:
register_initial_settings(): registerwp_page_for_privacy_policywith the REST namepage_for_privacy_policy.rest_restrict_privacy_policy_page_setting_update(): ignore updates from users withoutmanage_privacy_options. The settings endpoint only checksmanage_options, and on multisitemanage_privacy_optionsmaps tomanage_network, so a site administrator could otherwise change the page over REST but not in Settings > Privacy.Trac ticket:
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Fable 5.1
Used for: Drafting the change and the tests; reviewed and tested by me.