Changeset 63526 for trunk/src/wp-includes/rest-api.php
- Timestamp:
- 09/08/2026 08:41:22 AM (15 hours ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/rest-api.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r63509 r63526 3448 3448 } 3449 3449 3450 /** 3451 * Prevents users without the `manage_privacy_options` capability from 3452 * changing the privacy policy page through the REST API. 3453 * 3454 * The settings endpoint only checks `manage_options`. On multisite the 3455 * `manage_privacy_options` capability maps to `manage_network`, so a site 3456 * administrator can read the setting but must not change it, matching the 3457 * Settings > Privacy screen. 3458 * 3459 * @since 7.2.0 3460 * 3461 * @param bool $updated Whether the setting update has already been handled. 3462 * @param string $name Setting name (as shown in REST API responses). 3463 * @return bool Whether to short-circuit the update. 3464 */ 3465 function rest_restrict_privacy_policy_page_setting_update( $updated, $name ) { 3466 if ( 'page_for_privacy_policy' === $name && ! current_user_can( 'manage_privacy_options' ) ) { 3467 return true; 3468 } 3469 return $updated; 3470 } 3450 3471 3451 3472 /**
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)