Skip to content

Commit 88cb699

Browse files
committed
Restore: Sync Gutenberg @ 7bf80ea84eb8b62eceb1bb3fe82e42163673ca79
See changelog in e626725 > Build: Improve Gutenberg integration workflow. > This changeset improves the Gutenberg build integration to simplify the developer workflow and reinstore a flow similar to how package dependencies worked before the Gutenberg checkout-and-build approach was introduced. > > Key improvements: git-svn-id: https://develop.svn.wordpress.org/branches/fixes-64393-restore-version-history@62121 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a081643 commit 88cb699

7 files changed

Lines changed: 321 additions & 142 deletions

File tree

src/wp-includes/build/pages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Pages loader - Auto-generated by build process.
44
* Do not edit this file manually.
55
*
6-
* @package gutenberg
6+
* @package wp
77
*/
88

99
require_once __DIR__ . '/pages/site-editor/page.php';

src/wp-includes/build/pages/font-library/page-wp-admin.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
* This version integrates with the standard WordPress admin interface,
88
* keeping the wp-admin sidebar and scripts/styles intact.
99
*
10-
* @package gutenberg
10+
* @package wp
1111
*/
1212

1313
// Global storage for font-library routes and menu items
14-
global $gutenberg_font_library_wp_admin_routes, $gutenberg_font_library_wp_admin_menu_items;
15-
$gutenberg_font_library_wp_admin_routes = array();
16-
$gutenberg_font_library_wp_admin_menu_items = array();
14+
global $wp_font_library_wp_admin_routes, $wp_font_library_wp_admin_menu_items;
15+
$wp_font_library_wp_admin_routes = array();
16+
$wp_font_library_wp_admin_menu_items = array();
1717

18-
if ( ! function_exists( 'register_font_library_wp_admin_route' ) ) {
18+
if ( ! function_exists( 'wp_register_font_library_wp_admin_route' ) ) {
1919
/**
2020
* Register a route for the font-library-wp-admin page.
2121
*
2222
* @param string $path Route path (e.g., '/types/$type/edit/$id').
2323
* @param string|null $content_module Script module ID for content (stage/inspector).
2424
* @param string|null $route_module Script module ID for route lifecycle hooks.
2525
*/
26-
function register_font_library_wp_admin_route( $path, $content_module = null, $route_module = null ) {
27-
global $gutenberg_font_library_wp_admin_routes;
26+
function wp_register_font_library_wp_admin_route( $path, $content_module = null, $route_module = null ) {
27+
global $wp_font_library_wp_admin_routes;
2828

2929
$route = array( 'path' => $path );
3030
if ( ! empty( $content_module ) ) {
@@ -34,11 +34,11 @@ function register_font_library_wp_admin_route( $path, $content_module = null, $r
3434
$route['route_module'] = $route_module;
3535
}
3636

37-
$gutenberg_font_library_wp_admin_routes[] = $route;
37+
$wp_font_library_wp_admin_routes[] = $route;
3838
}
3939
}
4040

41-
if ( ! function_exists( 'register_font_library_wp_admin_menu_item' ) ) {
41+
if ( ! function_exists( 'wp_register_font_library_wp_admin_menu_item' ) ) {
4242
/**
4343
* Register a menu item for the font-library-wp-admin page.
4444
* Note: Menu items are registered but not displayed in single-page mode.
@@ -48,8 +48,8 @@ function register_font_library_wp_admin_route( $path, $content_module = null, $r
4848
* @param string $to Route path to navigate to.
4949
* @param string $parent_id Optional. Parent menu item ID.
5050
*/
51-
function register_font_library_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) {
52-
global $gutenberg_font_library_wp_admin_menu_items;
51+
function wp_register_font_library_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) {
52+
global $wp_font_library_wp_admin_menu_items;
5353

5454
$menu_item = array(
5555
'id' => $id,
@@ -61,40 +61,40 @@ function register_font_library_wp_admin_menu_item( $id, $label, $to, $parent_id
6161
$menu_item['parent'] = $parent_id;
6262
}
6363

64-
$gutenberg_font_library_wp_admin_menu_items[] = $menu_item;
64+
$wp_font_library_wp_admin_menu_items[] = $menu_item;
6565
}
6666
}
6767

68-
if ( ! function_exists( 'get_font_library_wp_admin_routes' ) ) {
68+
if ( ! function_exists( 'wp_get_font_library_wp_admin_routes' ) ) {
6969
/**
7070
* Get all registered routes for the font-library-wp-admin page.
7171
*
7272
* @return array Array of route objects.
7373
*/
74-
function get_font_library_wp_admin_routes() {
75-
global $gutenberg_font_library_wp_admin_routes;
76-
return $gutenberg_font_library_wp_admin_routes ?? array();
74+
function wp_get_font_library_wp_admin_routes() {
75+
global $wp_font_library_wp_admin_routes;
76+
return $wp_font_library_wp_admin_routes ?? array();
7777
}
7878
}
7979

80-
if ( ! function_exists( 'get_font_library_wp_admin_menu_items' ) ) {
80+
if ( ! function_exists( 'wp_get_font_library_wp_admin_menu_items' ) ) {
8181
/**
8282
* Get all registered menu items for the font-library-wp-admin page.
8383
*
8484
* @return array Array of menu item objects.
8585
*/
86-
function get_font_library_wp_admin_menu_items() {
87-
global $gutenberg_font_library_wp_admin_menu_items;
88-
return $gutenberg_font_library_wp_admin_menu_items ?? array();
86+
function wp_get_font_library_wp_admin_menu_items() {
87+
global $wp_font_library_wp_admin_menu_items;
88+
return $wp_font_library_wp_admin_menu_items ?? array();
8989
}
9090
}
9191

92-
if ( ! function_exists( 'font_library_wp_admin_preload_data' ) ) {
92+
if ( ! function_exists( 'wp_font_library_wp_admin_preload_data' ) ) {
9393
/**
9494
* Preload REST API data for the font-library-wp-admin page.
9595
* Automatically called during page rendering.
9696
*/
97-
function font_library_wp_admin_preload_data() {
97+
function wp_font_library_wp_admin_preload_data() {
9898
// Define paths to preload - same for all pages
9999
$preload_paths = array(
100100
'/?_fields=description,gmt_offset,home,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
@@ -120,14 +120,14 @@ function font_library_wp_admin_preload_data() {
120120
}
121121
}
122122

123-
if ( ! function_exists( 'font_library_wp_admin_enqueue_scripts' ) ) {
123+
if ( ! function_exists( 'wp_font_library_wp_admin_enqueue_scripts' ) ) {
124124
/**
125125
* Enqueue scripts and styles for the font-library-wp-admin page.
126126
* Hooked to admin_enqueue_scripts.
127127
*
128128
* @param string $hook_suffix The current admin page.
129129
*/
130-
function font_library_wp_admin_enqueue_scripts( $hook_suffix ) {
130+
function wp_font_library_wp_admin_enqueue_scripts( $hook_suffix ) {
131131
// Check all possible ways this page can be accessed:
132132
// 1. Menu page via admin.php?page=font-library-wp-admin (plugin)
133133
// 2. Direct file via font-library.php (Core) - screen ID will be 'font-library'
@@ -145,10 +145,10 @@ function font_library_wp_admin_enqueue_scripts( $hook_suffix ) {
145145
do_action( 'font-library-wp-admin_init' );
146146

147147
// Preload REST API data
148-
font_library_wp_admin_preload_data();
148+
wp_font_library_wp_admin_preload_data();
149149

150150
// Get all registered routes
151-
$routes = get_font_library_wp_admin_routes();
151+
$routes = wp_get_font_library_wp_admin_routes();
152152

153153
// Get boot module asset file for dependencies
154154
$asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php';
@@ -218,13 +218,13 @@ function ( $handle ) {
218218
}
219219
}
220220

221-
if ( ! function_exists( 'font_library_wp_admin_render_page' ) ) {
221+
if ( ! function_exists( 'wp_font_library_wp_admin_render_page' ) ) {
222222
/**
223223
* Render the font-library-wp-admin page.
224224
* Call this function from add_menu_page or add_submenu_page.
225225
* This renders within the normal WordPress admin interface.
226226
*/
227-
function font_library_wp_admin_render_page() {
227+
function wp_font_library_wp_admin_render_page() {
228228
?>
229229
<style>
230230
/* Critical styles to prevent layout shifts - inlined for immediate application */
@@ -285,5 +285,5 @@ function font_library_wp_admin_render_page() {
285285
}
286286

287287
// Hook the enqueue function to admin_enqueue_scripts
288-
add_action( 'admin_enqueue_scripts', 'font_library_wp_admin_enqueue_scripts' );
288+
add_action( 'admin_enqueue_scripts', 'wp_font_library_wp_admin_enqueue_scripts' );
289289

src/wp-includes/build/pages/font-library/page.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
* Auto-generated by build process.
55
* Do not edit this file manually.
66
*
7-
* @package gutenberg
7+
* @package wp
88
*/
99

1010
// Global storage for font-library routes and menu items
11-
global $gutenberg_font_library_routes, $gutenberg_font_library_menu_items;
12-
$gutenberg_font_library_routes = array();
13-
$gutenberg_font_library_menu_items = array();
11+
global $wp_font_library_routes, $wp_font_library_menu_items;
12+
$wp_font_library_routes = array();
13+
$wp_font_library_menu_items = array();
1414

15-
if ( ! function_exists( 'register_font_library_route' ) ) {
15+
if ( ! function_exists( 'wp_register_font_library_route' ) ) {
1616
/**
1717
* Register a route for the font-library page.
1818
*
1919
* @param string $path Route path (e.g., '/types/$type/edit/$id').
2020
* @param string|null $content_module Script module ID for content (stage/inspector).
2121
* @param string|null $route_module Script module ID for route lifecycle hooks.
2222
*/
23-
function register_font_library_route( $path, $content_module = null, $route_module = null ) {
24-
global $gutenberg_font_library_routes;
23+
function wp_register_font_library_route( $path, $content_module = null, $route_module = null ) {
24+
global $wp_font_library_routes;
2525

2626
$route = array( 'path' => $path );
2727
if ( ! empty( $content_module ) ) {
@@ -31,11 +31,11 @@ function register_font_library_route( $path, $content_module = null, $route_modu
3131
$route['route_module'] = $route_module;
3232
}
3333

34-
$gutenberg_font_library_routes[] = $route;
34+
$wp_font_library_routes[] = $route;
3535
}
3636
}
3737

38-
if ( ! function_exists( 'register_font_library_menu_item' ) ) {
38+
if ( ! function_exists( 'wp_register_font_library_menu_item' ) ) {
3939
/**
4040
* Register a menu item for the font-library page.
4141
*
@@ -45,8 +45,8 @@ function register_font_library_route( $path, $content_module = null, $route_modu
4545
* @param string $parent_id Optional. Parent menu item ID.
4646
* @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'.
4747
*/
48-
function register_font_library_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) {
49-
global $gutenberg_font_library_menu_items;
48+
function wp_register_font_library_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) {
49+
global $wp_font_library_menu_items;
5050

5151
$menu_item = array(
5252
'id' => $id,
@@ -62,40 +62,40 @@ function register_font_library_menu_item( $id, $label, $to, $parent_id = '', $pa
6262
$menu_item['parent_type'] = $parent_type;
6363
}
6464

65-
$gutenberg_font_library_menu_items[] = $menu_item;
65+
$wp_font_library_menu_items[] = $menu_item;
6666
}
6767
}
6868

69-
if ( ! function_exists( 'get_font_library_routes' ) ) {
69+
if ( ! function_exists( 'wp_get_font_library_routes' ) ) {
7070
/**
7171
* Get all registered routes for the font-library page.
7272
*
7373
* @return array Array of route objects.
7474
*/
75-
function get_font_library_routes() {
76-
global $gutenberg_font_library_routes;
77-
return $gutenberg_font_library_routes ?? array();
75+
function wp_get_font_library_routes() {
76+
global $wp_font_library_routes;
77+
return $wp_font_library_routes ?? array();
7878
}
7979
}
8080

81-
if ( ! function_exists( 'get_font_library_menu_items' ) ) {
81+
if ( ! function_exists( 'wp_get_font_library_menu_items' ) ) {
8282
/**
8383
* Get all registered menu items for the font-library page.
8484
*
8585
* @return array Array of menu item objects.
8686
*/
87-
function get_font_library_menu_items() {
88-
global $gutenberg_font_library_menu_items;
89-
return $gutenberg_font_library_menu_items ?? array();
87+
function wp_get_font_library_menu_items() {
88+
global $wp_font_library_menu_items;
89+
return $wp_font_library_menu_items ?? array();
9090
}
9191
}
9292

93-
if ( ! function_exists( 'font_library_preload_data' ) ) {
93+
if ( ! function_exists( 'wp_font_library_preload_data' ) ) {
9494
/**
9595
* Preload REST API data for the font-library page.
9696
* Automatically called during page rendering.
9797
*/
98-
function font_library_preload_data() {
98+
function wp_font_library_preload_data() {
9999
// Define paths to preload - same for all pages
100100
$preload_paths = array(
101101
'/?_fields=description,gmt_offset,home,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front',
@@ -121,12 +121,12 @@ function font_library_preload_data() {
121121
}
122122
}
123123

124-
if ( ! function_exists( 'font_library_render_page' ) ) {
124+
if ( ! function_exists( 'wp_font_library_render_page' ) ) {
125125
/**
126126
* Render the font-library page.
127127
* Call this function from add_menu_page or add_submenu_page.
128128
*/
129-
function font_library_render_page() {
129+
function wp_font_library_render_page() {
130130
// Set current screen
131131
set_current_screen();
132132

@@ -145,11 +145,11 @@ function font_library_render_page() {
145145
do_action( 'font-library_init' );
146146

147147
// Preload REST API data
148-
font_library_preload_data();
148+
wp_font_library_preload_data();
149149

150150
// Get all registered routes and menu items
151-
$menu_items = get_font_library_menu_items();
152-
$routes = get_font_library_routes();
151+
$menu_items = wp_get_font_library_menu_items();
152+
$routes = wp_get_font_library_routes();
153153

154154
// Get boot module asset file for dependencies
155155
$asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php';
@@ -303,19 +303,19 @@ function ( $handle ) {
303303
}
304304
}
305305

306-
if ( ! function_exists( 'font_library_intercept_render' ) ) {
306+
if ( ! function_exists( 'wp_font_library_intercept_render' ) ) {
307307
/**
308308
* Intercept admin_init to render the page early.
309309
* This bypasses the default WordPress admin template.
310310
*/
311-
function font_library_intercept_render() {
311+
function wp_font_library_intercept_render() {
312312
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
313313
if ( isset( $_GET['page'] ) && 'font-library' === $_GET['page'] ) {
314-
font_library_render_page();
314+
wp_font_library_render_page();
315315
exit;
316316
}
317317
}
318318
}
319319

320320
// Hook the interceptor to admin_init
321-
add_action( 'admin_init', 'font_library_intercept_render' );
321+
add_action( 'admin_init', 'wp_font_library_intercept_render' );

0 commit comments

Comments
 (0)