Changeset 59795
- Timestamp:
- 02/10/2025 03:54:35 AM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-blocks.php
r59316 r59795 52 52 $rest_path = rest_get_route_for_post( $post ); 53 53 54 $active_theme = get_stylesheet();55 54 $active_theme = get_stylesheet(); 55 $global_styles_endpoint_context = current_user_can( 'edit_theme_options' ) ? 'edit' : 'view'; 56 56 // Preload common data. 57 57 $preload_paths = array( … … 72 72 '/wp/v2/themes?context=edit&status=active', 73 73 array( '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id(), 'OPTIONS' ), 74 '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=edit', 74 /* 75 * Preload the global styles path with the correct context based on user caps. 76 * NOTE: There is an equivalent conditional check in the client-side code to fetch 77 * the global styles entity using the appropriate context value. 78 * See the call to `canUser()`, under `useGlobalStylesUserConfig()` in `packages/edit-site/src/components/use-global-styles-user-config/index.js`. 79 * Please ensure that the equivalent check is kept in sync with this preload path. 80 */ 81 '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=' . $global_styles_endpoint_context, 75 82 ); 76 83
Note: See TracChangeset
for help on using the changeset viewer.