c1787029 by Jeremy Groot

wp core update

1 parent f0410789
...@@ -45,7 +45,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ...@@ -45,7 +45,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
45 45
46 <div class="about__section changelog has-subtle-background-color"> 46 <div class="about__section changelog has-subtle-background-color">
47 <div class="column"> 47 <div class="column">
48 <h2><?php _e( 'Maintenance Release' ); ?></h2> 48 <h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
49 <p> 49 <p>
50 <?php 50 <?php
51 printf( 51 printf(
...@@ -53,7 +53,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ...@@ -53,7 +53,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
53 _n( 53 _n(
54 '<strong>Version %1$s</strong> addressed %2$s bug.', 54 '<strong>Version %1$s</strong> addressed %2$s bug.',
55 '<strong>Version %1$s</strong> addressed %2$s bugs.', 55 '<strong>Version %1$s</strong> addressed %2$s bugs.',
56 10 56 4
57 ), 57 ),
58 '6.4.1', 58 '6.4.1',
59 '4' 59 '4'
...@@ -71,6 +71,31 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ...@@ -71,6 +71,31 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
71 ); 71 );
72 ?> 72 ?>
73 </p> 73 </p>
74 <p>
75 <?php
76 printf(
77 /* translators: 1: WordPress version number, 2: Plural number of bugs. */
78 _n(
79 '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
80 '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.',
81 7
82 ),
83 '6.4.2',
84 '7'
85 );
86 ?>
87 <?php
88 printf(
89 /* translators: %s: HelpHub URL. */
90 __( 'For more information, see <a href="%s">the release notes</a>.' ),
91 sprintf(
92 /* translators: %s: WordPress version. */
93 esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
94 sanitize_title( '6.4.2' )
95 )
96 );
97 ?>
98 </p>
74 </div> 99 </div>
75 </div> 100 </div>
76 101
...@@ -272,7 +297,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ...@@ -272,7 +297,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
272 <p style="margin-top:calc(var(--gap) / 2);"> 297 <p style="margin-top:calc(var(--gap) / 2);">
273 <?php 298 <?php
274 printf( 299 printf(
275 /* translators: %s: WordPress Field Guide link. */ 300 /* translators: 1: WordPress Field Guide link, 2: WordPress version number. */
276 __( 'Explore the <a href="%1$s">WordPress %2$s Field Guide</a>. Learn about the changes in this release with detailed developer notes to help you build with WordPress.' ), 301 __( 'Explore the <a href="%1$s">WordPress %2$s Field Guide</a>. Learn about the changes in this release with detailed developer notes to help you build with WordPress.' ),
277 __( 'https://make.wordpress.org/core/2023/10/23/wordpress-6-4-field-guide/' ), 302 __( 'https://make.wordpress.org/core/2023/10/23/wordpress-6-4-field-guide/' ),
278 '6.4' 303 '6.4'
......
...@@ -535,8 +535,8 @@ ...@@ -535,8 +535,8 @@
535 position: relative; 535 position: relative;
536 display: flex; 536 display: flex;
537 flex-direction: column; 537 flex-direction: column;
538 align-items: start; 538 align-items: flex-start;
539 justify-content: end; 539 justify-content: flex-end;
540 box-sizing: border-box; 540 box-sizing: border-box;
541 padding: var(--gap) 0; 541 padding: var(--gap) 0;
542 height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem); 542 height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem);
...@@ -1127,7 +1127,7 @@ ...@@ -1127,7 +1127,7 @@
1127 } 1127 }
1128 1128
1129 .about-wrap .is-vertically-aligned-top { 1129 .about-wrap .is-vertically-aligned-top {
1130 align-self: start; 1130 align-self: flex-start;
1131 } 1131 }
1132 1132
1133 .about-wrap .is-vertically-aligned-center { 1133 .about-wrap .is-vertically-aligned-center {
......
...@@ -534,8 +534,8 @@ ...@@ -534,8 +534,8 @@
534 position: relative; 534 position: relative;
535 display: flex; 535 display: flex;
536 flex-direction: column; 536 flex-direction: column;
537 align-items: start; 537 align-items: flex-start;
538 justify-content: end; 538 justify-content: flex-end;
539 box-sizing: border-box; 539 box-sizing: border-box;
540 padding: var(--gap) 0; 540 padding: var(--gap) 0;
541 height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem); 541 height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem);
...@@ -1126,7 +1126,7 @@ ...@@ -1126,7 +1126,7 @@
1126 } 1126 }
1127 1127
1128 .about-wrap .is-vertically-aligned-top { 1128 .about-wrap .is-vertically-aligned-top {
1129 align-self: start; 1129 align-self: flex-start;
1130 } 1130 }
1131 1131
1132 .about-wrap .is-vertically-aligned-center { 1132 .about-wrap .is-vertically-aligned-center {
......
...@@ -324,7 +324,7 @@ function _register_remote_theme_patterns() { ...@@ -324,7 +324,7 @@ function _register_remote_theme_patterns() {
324 * @since 6.0.0 324 * @since 6.0.0
325 * @since 6.1.0 The `postTypes` property was added. 325 * @since 6.1.0 The `postTypes` property was added.
326 * @since 6.2.0 The `templateTypes` property was added. 326 * @since 6.2.0 The `templateTypes` property was added.
327 * @since 6.4.0 Uses the `_wp_get_block_patterns` function. 327 * @since 6.4.0 Uses the `WP_Theme::get_block_patterns` method.
328 * @access private 328 * @access private
329 */ 329 */
330 function _register_theme_block_patterns() { 330 function _register_theme_block_patterns() {
......
...@@ -518,12 +518,12 @@ function _remove_theme_attribute_from_template_part_block( &$block ) { ...@@ -518,12 +518,12 @@ function _remove_theme_attribute_from_template_part_block( &$block ) {
518 */ 518 */
519 function _build_block_template_result_from_file( $template_file, $template_type ) { 519 function _build_block_template_result_from_file( $template_file, $template_type ) {
520 $default_template_types = get_default_block_template_types(); 520 $default_template_types = get_default_block_template_types();
521 $template_content = file_get_contents( $template_file['path'] );
522 $theme = get_stylesheet(); 521 $theme = get_stylesheet();
523 522
524 $template = new WP_Block_Template(); 523 $template = new WP_Block_Template();
525 $template->id = $theme . '//' . $template_file['slug']; 524 $template->id = $theme . '//' . $template_file['slug'];
526 $template->theme = $theme; 525 $template->theme = $theme;
526 $template->content = file_get_contents( $template_file['path'] );
527 $template->slug = $template_file['slug']; 527 $template->slug = $template_file['slug'];
528 $template->source = 'theme'; 528 $template->source = 'theme';
529 $template->type = $template_type; 529 $template->type = $template_type;
...@@ -554,7 +554,7 @@ function _build_block_template_result_from_file( $template_file, $template_type ...@@ -554,7 +554,7 @@ function _build_block_template_result_from_file( $template_file, $template_type
554 $before_block_visitor = make_before_block_visitor( $hooked_blocks, $template ); 554 $before_block_visitor = make_before_block_visitor( $hooked_blocks, $template );
555 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $template ); 555 $after_block_visitor = make_after_block_visitor( $hooked_blocks, $template );
556 } 556 }
557 $blocks = parse_blocks( $template_content ); 557 $blocks = parse_blocks( $template->content );
558 $template->content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor ); 558 $template->content = traverse_and_serialize_blocks( $blocks, $before_block_visitor, $after_block_visitor );
559 559
560 return $template; 560 return $template;
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
116 * 116 *
117 * Example: 117 * Example:
118 * 118 *
119 * if ( $tags->next_tag( array( 'class' => 'wp-group-block' ) ) ) { 119 * if ( $tags->next_tag( array( 'class_name' => 'wp-group-block' ) ) ) {
120 * $tags->set_attribute( 'title', 'This groups the contained content.' ); 120 * $tags->set_attribute( 'title', 'This groups the contained content.' );
121 * $tags->remove_attribute( 'data-test-id' ); 121 * $tags->remove_attribute( 'data-test-id' );
122 * } 122 * }
......
...@@ -94,4 +94,13 @@ class WP_HTML_Token { ...@@ -94,4 +94,13 @@ class WP_HTML_Token {
94 call_user_func( $this->on_destroy, $this->bookmark_name ); 94 call_user_func( $this->on_destroy, $this->bookmark_name );
95 } 95 }
96 } 96 }
97
98 /**
99 * Wakeup magic method.
100 *
101 * @since 6.4.2
102 */
103 public function __wakeup() {
104 throw new \LogicException( __CLASS__ . ' should never be unserialized' );
105 }
97 } 106 }
......
...@@ -491,8 +491,6 @@ function update_blog_option( $id, $option, $value, $deprecated = null ) { ...@@ -491,8 +491,6 @@ function update_blog_option( $id, $option, $value, $deprecated = null ) {
491 * @global array $_wp_switched_stack 491 * @global array $_wp_switched_stack
492 * @global bool $switched 492 * @global bool $switched
493 * @global string $table_prefix 493 * @global string $table_prefix
494 * @global string $wp_template_path
495 * @global string $wp_stylesheet_path
496 * @global WP_Object_Cache $wp_object_cache 494 * @global WP_Object_Cache $wp_object_cache
497 * 495 *
498 * @param int $new_blog_id The ID of the blog to switch to. Default: current blog. 496 * @param int $new_blog_id The ID of the blog to switch to. Default: current blog.
...@@ -534,10 +532,8 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) { ...@@ -534,10 +532,8 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
534 } 532 }
535 533
536 $wpdb->set_blog_id( $new_blog_id ); 534 $wpdb->set_blog_id( $new_blog_id );
537 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix(); 535 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
538 $GLOBALS['blog_id'] = $new_blog_id; 536 $GLOBALS['blog_id'] = $new_blog_id;
539 $GLOBALS['wp_template_path'] = null;
540 $GLOBALS['wp_stylesheet_path'] = null;
541 537
542 if ( function_exists( 'wp_cache_switch_to_blog' ) ) { 538 if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
543 wp_cache_switch_to_blog( $new_blog_id ); 539 wp_cache_switch_to_blog( $new_blog_id );
...@@ -604,8 +600,6 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) { ...@@ -604,8 +600,6 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
604 * @global int $blog_id 600 * @global int $blog_id
605 * @global bool $switched 601 * @global bool $switched
606 * @global string $table_prefix 602 * @global string $table_prefix
607 * @global string $wp_template_path
608 * @global string $wp_stylesheet_path
609 * @global WP_Object_Cache $wp_object_cache 603 * @global WP_Object_Cache $wp_object_cache
610 * 604 *
611 * @return bool True on success, false if we're already on the current blog. 605 * @return bool True on success, false if we're already on the current blog.
...@@ -631,10 +625,8 @@ function restore_current_blog() { ...@@ -631,10 +625,8 @@ function restore_current_blog() {
631 } 625 }
632 626
633 $wpdb->set_blog_id( $new_blog_id ); 627 $wpdb->set_blog_id( $new_blog_id );
634 $GLOBALS['blog_id'] = $new_blog_id; 628 $GLOBALS['blog_id'] = $new_blog_id;
635 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix(); 629 $GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
636 $GLOBALS['wp_template_path'] = null;
637 $GLOBALS['wp_stylesheet_path'] = null;
638 630
639 if ( function_exists( 'wp_cache_switch_to_blog' ) ) { 631 if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
640 wp_cache_switch_to_blog( $new_blog_id ); 632 wp_cache_switch_to_blog( $new_blog_id );
......
...@@ -1294,6 +1294,13 @@ class WP_REST_Server { ...@@ -1294,6 +1294,13 @@ class WP_REST_Server {
1294 $this->add_active_theme_link_to_index( $response ); 1294 $this->add_active_theme_link_to_index( $response );
1295 $this->add_site_logo_to_index( $response ); 1295 $this->add_site_logo_to_index( $response );
1296 $this->add_site_icon_to_index( $response ); 1296 $this->add_site_icon_to_index( $response );
1297 } else {
1298 if ( rest_is_field_included( 'site_logo', $fields ) ) {
1299 $this->add_site_logo_to_index( $response );
1300 }
1301 if ( rest_is_field_included( 'site_icon', $fields ) || rest_is_field_included( 'site_icon_url', $fields ) ) {
1302 $this->add_site_icon_to_index( $response );
1303 }
1297 } 1304 }
1298 1305
1299 /** 1306 /**
......
...@@ -188,39 +188,25 @@ function get_stylesheet() { ...@@ -188,39 +188,25 @@ function get_stylesheet() {
188 * 188 *
189 * @since 1.5.0 189 * @since 1.5.0
190 * @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme. 190 * @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme.
191 * 191 * @since 6.4.2 Memoization removed.
192 * @global string $wp_stylesheet_path Current theme stylesheet directory path.
193 * 192 *
194 * @return string Path to active theme's stylesheet directory. 193 * @return string Path to active theme's stylesheet directory.
195 */ 194 */
196 function get_stylesheet_directory() { 195 function get_stylesheet_directory() {
197 global $wp_stylesheet_path; 196 $stylesheet = get_stylesheet();
198 197 $theme_root = get_theme_root( $stylesheet );
199 if ( null === $wp_stylesheet_path ) { 198 $stylesheet_dir = "$theme_root/$stylesheet";
200 $stylesheet = get_stylesheet();
201 $theme_root = get_theme_root( $stylesheet );
202 $stylesheet_dir = "$theme_root/$stylesheet";
203
204 /**
205 * Filters the stylesheet directory path for the active theme.
206 *
207 * @since 1.5.0
208 *
209 * @param string $stylesheet_dir Absolute path to the active theme.
210 * @param string $stylesheet Directory name of the active theme.
211 * @param string $theme_root Absolute path to themes directory.
212 */
213 $stylesheet_dir = apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
214
215 // If there are filter callbacks, force the logic to execute on every call.
216 if ( has_filter( 'stylesheet' ) || has_filter( 'theme_root' ) || has_filter( 'stylesheet_directory' ) ) {
217 return $stylesheet_dir;
218 }
219 199
220 $wp_stylesheet_path = $stylesheet_dir; 200 /**
221 } 201 * Filters the stylesheet directory path for the active theme.
222 202 *
223 return $wp_stylesheet_path; 203 * @since 1.5.0
204 *
205 * @param string $stylesheet_dir Absolute path to the active theme.
206 * @param string $stylesheet Directory name of the active theme.
207 * @param string $theme_root Absolute path to themes directory.
208 */
209 return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
224 } 210 }
225 211
226 /** 212 /**
...@@ -338,39 +324,25 @@ function get_template() { ...@@ -338,39 +324,25 @@ function get_template() {
338 * 324 *
339 * @since 1.5.0 325 * @since 1.5.0
340 * @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme. 326 * @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme.
341 * 327 * @since 6.4.1 Memoization removed.
342 * @global string $wp_template_path Current theme template directory path.
343 * 328 *
344 * @return string Path to active theme's template directory. 329 * @return string Path to active theme's template directory.
345 */ 330 */
346 function get_template_directory() { 331 function get_template_directory() {
347 global $wp_template_path; 332 $template = get_template();
348 333 $theme_root = get_theme_root( $template );
349 if ( null === $wp_template_path ) { 334 $template_dir = "$theme_root/$template";
350 $template = get_template();
351 $theme_root = get_theme_root( $template );
352 $template_dir = "$theme_root/$template";
353 335
354 /** 336 /**
355 * Filters the active theme directory path. 337 * Filters the active theme directory path.
356 * 338 *
357 * @since 1.5.0 339 * @since 1.5.0
358 * 340 *
359 * @param string $template_dir The path of the active theme directory. 341 * @param string $template_dir The path of the active theme directory.
360 * @param string $template Directory name of the active theme. 342 * @param string $template Directory name of the active theme.
361 * @param string $theme_root Absolute path to the themes directory. 343 * @param string $theme_root Absolute path to the themes directory.
362 */ 344 */
363 $template_dir = apply_filters( 'template_directory', $template_dir, $template, $theme_root ); 345 return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
364
365 // If there are filter callbacks, force the logic to execute on every call.
366 if ( has_filter( 'template' ) || has_filter( 'theme_root' ) || has_filter( 'template_directory' ) ) {
367 return $template_dir;
368 }
369
370 $wp_template_path = $template_dir;
371 }
372
373 return $wp_template_path;
374 } 346 }
375 347
376 /** 348 /**
...@@ -776,13 +748,11 @@ function locale_stylesheet() { ...@@ -776,13 +748,11 @@ function locale_stylesheet() {
776 * @global WP_Customize_Manager $wp_customize 748 * @global WP_Customize_Manager $wp_customize
777 * @global array $sidebars_widgets 749 * @global array $sidebars_widgets
778 * @global array $wp_registered_sidebars 750 * @global array $wp_registered_sidebars
779 * @global string $wp_stylesheet_path
780 * @global string $wp_template_path
781 * 751 *
782 * @param string $stylesheet Stylesheet name. 752 * @param string $stylesheet Stylesheet name.
783 */ 753 */
784 function switch_theme( $stylesheet ) { 754 function switch_theme( $stylesheet ) {
785 global $wp_theme_directories, $wp_customize, $sidebars_widgets, $wp_registered_sidebars, $wp_stylesheet_path, $wp_template_path; 755 global $wp_theme_directories, $wp_customize, $sidebars_widgets, $wp_registered_sidebars;
786 756
787 $requirements = validate_theme_requirements( $stylesheet ); 757 $requirements = validate_theme_requirements( $stylesheet );
788 if ( is_wp_error( $requirements ) ) { 758 if ( is_wp_error( $requirements ) ) {
...@@ -866,13 +836,6 @@ function switch_theme( $stylesheet ) { ...@@ -866,13 +836,6 @@ function switch_theme( $stylesheet ) {
866 836
867 update_option( 'theme_switched', $old_theme->get_stylesheet() ); 837 update_option( 'theme_switched', $old_theme->get_stylesheet() );
868 838
869 /*
870 * Reset globals to force refresh the next time these directories are
871 * accessed via `get_stylesheet_directory()` / `get_template_directory()`.
872 */
873 $wp_stylesheet_path = null;
874 $wp_template_path = null;
875
876 // Clear pattern caches. 839 // Clear pattern caches.
877 $new_theme->delete_pattern_cache(); 840 $new_theme->delete_pattern_cache();
878 $old_theme->delete_pattern_cache(); 841 $old_theme->delete_pattern_cache();
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
16 * 16 *
17 * @global string $wp_version 17 * @global string $wp_version
18 */ 18 */
19 $wp_version = '6.4.1'; 19 $wp_version = '6.4.2';
20 20
21 /** 21 /**
22 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. 22 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
......