Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/6.4' into try/6-4-update-nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
desrosj committed Dec 20, 2023
2 parents a427243 + 02e0733 commit bd5b6ea
Show file tree
Hide file tree
Showing 18 changed files with 382 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LOCAL_PORT=8889
LOCAL_DIR=src

# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
LOCAL_PHP=latest
LOCAL_PHP=8.3-fpm

# Whether or not to enable Xdebug.
LOCAL_PHP_XDEBUG=false
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WordPress",
"version": "6.4.2",
"version": "6.4.3",
"description": "WordPress is open source software you can use to create a beautiful website, blog, or app.",
"repository": {
"type": "svn",
Expand Down Expand Up @@ -198,4 +198,4 @@
"sync-gutenberg-packages": "grunt sync-gutenberg-packages",
"postsync-gutenberg-packages": "grunt wp-packages:sync-stable-blocks && grunt build --dev && grunt build"
}
}
}
29 changes: 27 additions & 2 deletions src/wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@

<div class="about__section changelog has-subtle-background-color">
<div class="column">
<h2><?php _e( 'Maintenance Release' ); ?></h2>
<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
10
4
),
'6.4.1',
'4'
Expand All @@ -71,6 +71,31 @@
);
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.',
7
),
'6.4.2',
'7'
);
?>
<?php
printf(
/* translators: %s: HelpHub URL. */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
sprintf(
/* translators: %s: WordPress version. */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( '6.4.2' )
)
);
?>
</p>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/css/about.css
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@
position: relative;
display: flex;
flex-direction: column;
align-items: start;
justify-content: end;
align-items: flex-start;
justify-content: flex-end;
box-sizing: border-box;
padding: var(--gap) 0;
height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem);
Expand Down Expand Up @@ -1126,7 +1126,7 @@
}

.about-wrap .is-vertically-aligned-top {
align-self: start;
align-self: flex-start;
}

.about-wrap .is-vertically-aligned-center {
Expand Down
9 changes: 9 additions & 0 deletions src/wp-includes/html-api/class-wp-html-token.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,13 @@ public function __destruct() {
call_user_func( $this->on_destroy, $this->bookmark_name );
}
}

/**
* Wakeup magic method.
*
* @since 6.4.2
*/
public function __wakeup() {
throw new \LogicException( __CLASS__ . ' should never be unserialized' );
}
}
16 changes: 4 additions & 12 deletions src/wp-includes/ms-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ function update_blog_option( $id, $option, $value, $deprecated = null ) {
* @global array $_wp_switched_stack
* @global bool $switched
* @global string $table_prefix
* @global string $wp_template_path
* @global string $wp_stylesheet_path
* @global WP_Object_Cache $wp_object_cache
*
* @param int $new_blog_id The ID of the blog to switch to. Default: current blog.
Expand Down Expand Up @@ -534,10 +532,8 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
}

$wpdb->set_blog_id( $new_blog_id );
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
$GLOBALS['blog_id'] = $new_blog_id;
$GLOBALS['wp_template_path'] = null;
$GLOBALS['wp_stylesheet_path'] = null;
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
$GLOBALS['blog_id'] = $new_blog_id;

if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
wp_cache_switch_to_blog( $new_blog_id );
Expand Down Expand Up @@ -604,8 +600,6 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
* @global int $blog_id
* @global bool $switched
* @global string $table_prefix
* @global string $wp_template_path
* @global string $wp_stylesheet_path
* @global WP_Object_Cache $wp_object_cache
*
* @return bool True on success, false if we're already on the current blog.
Expand All @@ -631,10 +625,8 @@ function restore_current_blog() {
}

$wpdb->set_blog_id( $new_blog_id );
$GLOBALS['blog_id'] = $new_blog_id;
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();
$GLOBALS['wp_template_path'] = null;
$GLOBALS['wp_stylesheet_path'] = null;
$GLOBALS['blog_id'] = $new_blog_id;
$GLOBALS['table_prefix'] = $wpdb->get_blog_prefix();

if ( function_exists( 'wp_cache_switch_to_blog' ) ) {
wp_cache_switch_to_blog( $new_blog_id );
Expand Down
7 changes: 7 additions & 0 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,13 @@ public function get_index( $request ) {
$this->add_active_theme_link_to_index( $response );
$this->add_site_logo_to_index( $response );
$this->add_site_icon_to_index( $response );
} else {
if ( rest_is_field_included( 'site_logo', $fields ) ) {
$this->add_site_logo_to_index( $response );
}
if ( rest_is_field_included( 'site_icon', $fields ) || rest_is_field_included( 'site_icon_url', $fields ) ) {
$this->add_site_icon_to_index( $response );
}
}

/**
Expand Down
95 changes: 29 additions & 66 deletions src/wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,39 +188,25 @@ function get_stylesheet() {
*
* @since 1.5.0
* @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme.
*
* @global string $wp_stylesheet_path Current theme stylesheet directory path.
* @since 6.4.2 Memoization removed.
*
* @return string Path to active theme's stylesheet directory.
*/
function get_stylesheet_directory() {
global $wp_stylesheet_path;

if ( null === $wp_stylesheet_path ) {
$stylesheet = get_stylesheet();
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";

/**
* Filters the stylesheet directory path for the active theme.
*
* @since 1.5.0
*
* @param string $stylesheet_dir Absolute path to the active theme.
* @param string $stylesheet Directory name of the active theme.
* @param string $theme_root Absolute path to themes directory.
*/
$stylesheet_dir = apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );

// If there are filter callbacks, force the logic to execute on every call.
if ( has_filter( 'stylesheet' ) || has_filter( 'theme_root' ) || has_filter( 'stylesheet_directory' ) ) {
return $stylesheet_dir;
}
$stylesheet = get_stylesheet();
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";

$wp_stylesheet_path = $stylesheet_dir;
}

return $wp_stylesheet_path;
/**
* Filters the stylesheet directory path for the active theme.
*
* @since 1.5.0
*
* @param string $stylesheet_dir Absolute path to the active theme.
* @param string $stylesheet Directory name of the active theme.
* @param string $theme_root Absolute path to themes directory.
*/
return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}

/**
Expand Down Expand Up @@ -338,39 +324,25 @@ function get_template() {
*
* @since 1.5.0
* @since 6.4.0 Memoizes filter execution so that it only runs once for the current theme.
*
* @global string $wp_template_path Current theme template directory path.
* @since 6.4.1 Memoization removed.
*
* @return string Path to active theme's template directory.
*/
function get_template_directory() {
global $wp_template_path;

if ( null === $wp_template_path ) {
$template = get_template();
$theme_root = get_theme_root( $template );
$template_dir = "$theme_root/$template";
$template = get_template();
$theme_root = get_theme_root( $template );
$template_dir = "$theme_root/$template";

/**
* Filters the active theme directory path.
*
* @since 1.5.0
*
* @param string $template_dir The path of the active theme directory.
* @param string $template Directory name of the active theme.
* @param string $theme_root Absolute path to the themes directory.
*/
$template_dir = apply_filters( 'template_directory', $template_dir, $template, $theme_root );

// If there are filter callbacks, force the logic to execute on every call.
if ( has_filter( 'template' ) || has_filter( 'theme_root' ) || has_filter( 'template_directory' ) ) {
return $template_dir;
}

$wp_template_path = $template_dir;
}

return $wp_template_path;
/**
* Filters the active theme directory path.
*
* @since 1.5.0
*
* @param string $template_dir The path of the active theme directory.
* @param string $template Directory name of the active theme.
* @param string $theme_root Absolute path to the themes directory.
*/
return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
}

/**
Expand Down Expand Up @@ -776,13 +748,11 @@ function locale_stylesheet() {
* @global WP_Customize_Manager $wp_customize
* @global array $sidebars_widgets
* @global array $wp_registered_sidebars
* @global string $wp_stylesheet_path
* @global string $wp_template_path
*
* @param string $stylesheet Stylesheet name.
*/
function switch_theme( $stylesheet ) {
global $wp_theme_directories, $wp_customize, $sidebars_widgets, $wp_registered_sidebars, $wp_stylesheet_path, $wp_template_path;
global $wp_theme_directories, $wp_customize, $sidebars_widgets, $wp_registered_sidebars;

$requirements = validate_theme_requirements( $stylesheet );
if ( is_wp_error( $requirements ) ) {
Expand Down Expand Up @@ -866,13 +836,6 @@ function switch_theme( $stylesheet ) {

update_option( 'theme_switched', $old_theme->get_stylesheet() );

/*
* Reset globals to force refresh the next time these directories are
* accessed via `get_stylesheet_directory()` / `get_template_directory()`.
*/
$wp_stylesheet_path = null;
$wp_template_path = null;

// Clear pattern caches.
$new_theme->delete_pattern_cache();
$old_theme->delete_pattern_cache();
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4.2-alpha-57098-src';
$wp_version = '6.4.3-alpha-57167-src';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down
7 changes: 7 additions & 0 deletions tests/phpunit/data/themedir2/test-parent/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// Dummy theme.

echo __DIR__ . '/' . basename(__FILE__);

?>
7 changes: 7 additions & 0 deletions tests/phpunit/data/themedir2/test-parent/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// Dummy theme.

echo __DIR__ . '/' . basename(__FILE__);

?>
12 changes: 12 additions & 0 deletions tests/phpunit/data/themedir2/test-parent/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Theme Name: Test Parent Theme
Theme URI: http://example.org/
Description: An example parent theme
Version: 1.3
Author: Minnie Bannister
Author URI: http://example.com/
Template: test-parent
*/



7 changes: 7 additions & 0 deletions tests/phpunit/data/themedir2/test/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// Dummy theme.

echo __DIR__ . '/' . basename(__FILE__);

?>
7 changes: 7 additions & 0 deletions tests/phpunit/data/themedir2/test/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// Dummy theme.

echo __DIR__ . '/' . basename(__FILE__);

?>
12 changes: 12 additions & 0 deletions tests/phpunit/data/themedir2/test/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Theme Name: Test Theme
Theme URI: http://example.org/
Description: An example theme
Version: 1.3
Author: Minnie Bannister
Author URI: http://example.com/
Template: test-parent
*/



Loading

0 comments on commit bd5b6ea

Please sign in to comment.