Skip to content

Commit 311ec9a

Browse files
committed
Merge remote-tracking branch 'upstream/trunk' into add/mariadb-11-4
2 parents b90aa2c + 8eb8d63 commit 311ec9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+969
-638
lines changed

.github/workflows/install-testing.yml

Lines changed: 15 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ on:
1414
pull_request:
1515
# Always test the workflow when changes are suggested.
1616
paths:
17-
- '.github/workflows/install-testing.yml'
1817
- '.version-support-*.json'
18+
- '.github/workflows/install-testing.yml'
19+
- '.github/workflows/reusable-support-json-reader-v1.yml'
20+
1921
schedule:
2022
- cron: '0 0 * * 1'
2123
workflow_dispatch:
@@ -37,60 +39,16 @@ concurrency:
3739
permissions: {}
3840

3941
jobs:
40-
# Determines the appropriate values for PHP and database versions based on the WordPress version being tested.
41-
#
42-
# Performs the following steps:
43-
# - Checks out the repository.
44-
# - Fetches the versions of PHP to test.
45-
# - Fetches the versions of MySQL to test.
46-
build-matrix:
47-
name: Determine PHP Versions to test
48-
runs-on: ubuntu-latest
42+
# Determines the supported values for PHP and database versions based on the WordPress version being tested.
43+
build-test-matrix:
44+
name: Build Test Matrix
45+
uses: WordPress/wordpress-develop/.github/workflows/reusable-support-json-reader-v1.yml@trunk
46+
permissions:
47+
contents: read
48+
secrets: inherit
4949
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
50-
timeout-minutes: 5
51-
outputs:
52-
major-wp-version: ${{ steps.major-wp-version.outputs.version }}
53-
php-versions: ${{ steps.php-versions.outputs.versions }}
54-
mysql-versions: ${{ steps.mysql-versions.outputs.versions }}
55-
56-
steps:
57-
- name: Checkout repository
58-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
59-
with:
60-
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
61-
62-
- name: Determine the major WordPress version
63-
id: major-wp-version
64-
run: |
65-
if [ "${{ inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ]; then
66-
echo "version=$(echo "${{ inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT
67-
elif [ "${{ inputs.wp-version }}" ]; then
68-
echo "version=$(echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT
69-
else
70-
echo "version=nightly" >> $GITHUB_OUTPUT
71-
fi
72-
73-
# Look up the major version's specific PHP support policy when a version is provided.
74-
# Otherwise, use the current PHP support policy.
75-
- name: Get supported PHP versions
76-
id: php-versions
77-
run: |
78-
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then
79-
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
80-
else
81-
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
82-
fi
83-
84-
# Look up the major version's specific MySQL support policy when a version is provided.
85-
# Otherwise, use the current MySQL support policy.
86-
- name: Get supported MySQL versions
87-
id: mysql-versions
88-
run: |
89-
if [ "${{ steps.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ steps.major-wp-version.outputs.version }}" != "nightly" ]; then
90-
echo "versions=$(jq -r '.["${{ steps.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
91-
else
92-
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
93-
fi
50+
with:
51+
wp-version: ${{ inputs.wp-version }}
9452

9553
# Test the WordPress installation process through WP-CLI.
9654
#
@@ -106,14 +64,14 @@ jobs:
10664
runs-on: ${{ matrix.os }}
10765
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
10866
timeout-minutes: 10
109-
needs: [ build-matrix ]
67+
needs: [ build-test-matrix ]
11068
strategy:
11169
fail-fast: false
11270
matrix:
11371
os: [ ubuntu-latest ]
114-
php: ${{ fromJSON( needs.build-matrix.outputs.php-versions ) }}
72+
php: ${{ fromJSON( needs.build-test-matrix.outputs.php-versions ) }}
11573
db-type: [ 'mysql' ]
116-
db-version: ${{ fromJSON( needs.build-matrix.outputs.mysql-versions ) }}
74+
db-version: ${{ fromJSON( needs.build-test-matrix.outputs.mysql-versions ) }}
11775
multisite: [ false, true ]
11876
memcached: [ false ]
11977

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
##
2+
# A reusable workflow that reads the .version-support-*.json files and returns values for use in a
3+
# test matrix based on a given WordPress version.
4+
##
5+
name: Determine test matrix values
6+
7+
on:
8+
workflow_call:
9+
inputs:
10+
wp-version:
11+
description: 'The WordPress version to test . Accepts major and minor versions, "latest", or "nightly". Major releases must not end with ".0".'
12+
type: string
13+
default: 'nightly'
14+
outputs:
15+
major-wp-version:
16+
description: "The major WordPress version based on the version provided in wp-version"
17+
value: ${{ jobs.major-wp-version.outputs.version }}
18+
php-versions:
19+
description: "The PHP versions to test for the given wp-version"
20+
value: ${{ jobs.php-versions.outputs.versions }}
21+
mysql-versions:
22+
description: "The MySQL versions to test for the given wp-version"
23+
value: ${{ jobs.mysql-versions.outputs.versions }}
24+
25+
jobs:
26+
# Determines the major version of WordPress being tested.
27+
#
28+
# The data in the JSON files are indexed by major version, so this is used to look up the appropriate support policy.
29+
#
30+
# Performs the following steps:
31+
# - Checks out the repository
32+
# - Returns the major WordPress version as an output based on the value passed to the wp-version input.
33+
major-wp-version:
34+
name: Determine major WordPress version
35+
runs-on: ubuntu-latest
36+
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
37+
timeout-minutes: 5
38+
outputs:
39+
version: ${{ steps.major-wp-version.outputs.version }}
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
46+
47+
- name: Determine the major WordPress version
48+
id: major-wp-version
49+
run: |
50+
if [ "${{ inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ]; then
51+
echo "version=$(echo "${{ inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT
52+
elif [ "${{ inputs.wp-version }}" ]; then
53+
echo "version=$(echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT
54+
else
55+
echo "version=nightly" >> $GITHUB_OUTPUT
56+
fi
57+
58+
# Determines the versions of PHP supported for a version of WordPress.
59+
#
60+
# Performs the following steps:
61+
# - Checks out the repository
62+
# - Returns the versions of PHP supported for the major version of WordPress by parsing the
63+
# .version-support-php.json file and returning the values in that version's index.
64+
php-versions:
65+
name: Determine PHP versions
66+
runs-on: ubuntu-latest
67+
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
68+
needs: [ major-wp-version ]
69+
timeout-minutes: 5
70+
outputs:
71+
versions: ${{ steps.php-versions.outputs.versions }}
72+
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+
with:
77+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
78+
79+
# Look up the major version's specific PHP support policy when a version is provided.
80+
# Otherwise, use the current PHP support policy.
81+
- name: Get supported PHP versions
82+
id: php-versions
83+
run: |
84+
if [ "${{ needs.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ needs.major-wp-version.outputs.version }}" != "nightly" ]; then
85+
echo "versions=$(jq -r '.["${{ needs.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
86+
else
87+
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT
88+
fi
89+
90+
# Determines the versions of MySQL supported for a version of WordPress.
91+
#
92+
# Performs the following steps:
93+
# - Checks out the repository
94+
# - Returns the versions of MySQL supported for the major version of WordPress by parsing the
95+
# .version-support-mysql.json file and returning the values in that version's index.
96+
mysql-versions:
97+
name: Determine MySQL versions
98+
runs-on: ubuntu-latest
99+
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
100+
needs: [ major-wp-version ]
101+
timeout-minutes: 5
102+
outputs:
103+
versions: ${{ steps.mysql-versions.outputs.versions }}
104+
105+
steps:
106+
- name: Checkout repository
107+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
108+
with:
109+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
110+
111+
# Look up the major version's specific MySQL support policy when a version is provided.
112+
# Otherwise, use the current MySQL support policy.
113+
- name: Get supported MySQL versions
114+
id: mysql-versions
115+
run: |
116+
if [ "${{ needs.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ needs.major-wp-version.outputs.version }}" != "nightly" ]; then
117+
echo "versions=$(jq -r '.["${{ needs.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
118+
else
119+
echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT
120+
fi

src/js/_enqueues/admin/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ jQuery( function($) {
660660
function() {
661661
var t = $(this), c = t.is(':checked'), id = t.val();
662662
if ( id && t.parents('#taxonomy-'+taxonomy).length ) {
663-
$('input[id^="in-' + taxonomy + '-' + id + '"]').prop('checked', c);
663+
$('input#in-' + taxonomy + '-' + id + ', input[id^="in-' + taxonomy + '-' + id + '-"]').prop('checked', c);
664664
$('input#in-popular-' + taxonomy + '-' + id).prop('checked', c);
665665
}
666666
}

src/wp-admin/customize.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
$wp_customize->set_autofocus( $autofocus );
101101
}
102102

103+
// Let's roll.
104+
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
105+
106+
wp_user_settings();
107+
_wp_admin_html_begin();
108+
103109
$registered = $wp_scripts->registered;
104110
$wp_scripts = new WP_Scripts();
105111
$wp_scripts->registered = $registered;
@@ -126,12 +132,6 @@
126132
*/
127133
do_action( 'customize_controls_enqueue_scripts' );
128134

129-
// Let's roll.
130-
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
131-
132-
wp_user_settings();
133-
_wp_admin_html_begin();
134-
135135
$body_class = 'wp-core-ui wp-customizer js';
136136

137137
if ( wp_is_mobile() ) :

src/wp-admin/includes/class-wp-automatic-updater.php

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,14 @@ protected function send_email( $type, $core_update, $result = null ) {
936936
return;
937937
}
938938

939+
$admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) );
940+
941+
if ( $admin_user ) {
942+
$switched_locale = switch_to_user_locale( $admin_user->ID );
943+
} else {
944+
$switched_locale = switch_to_locale( get_locale() );
945+
}
946+
939947
switch ( $type ) {
940948
case 'success': // We updated.
941949
/* translators: Site updated notification email subject. 1: Site title, 2: WordPress version. */
@@ -1139,8 +1147,11 @@ protected function send_email( $type, $core_update, $result = null ) {
11391147
$email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
11401148

11411149
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
1142-
}
11431150

1151+
if ( $switched_locale ) {
1152+
restore_previous_locale();
1153+
}
1154+
}
11441155

11451156
/**
11461157
* Checks whether an email should be sent after attempting plugin or theme updates.
@@ -1255,6 +1266,14 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_
12551266
}
12561267
}
12571268

1269+
$admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) );
1270+
1271+
if ( $admin_user ) {
1272+
$switched_locale = switch_to_user_locale( $admin_user->ID );
1273+
} else {
1274+
$switched_locale = switch_to_locale( get_locale() );
1275+
}
1276+
12581277
$body = array();
12591278
$successful_plugins = ( ! empty( $successful_updates['plugin'] ) );
12601279
$successful_themes = ( ! empty( $successful_updates['theme'] ) );
@@ -1526,6 +1545,10 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_
15261545
if ( $result ) {
15271546
update_option( 'auto_plugin_theme_update_emails', $past_failure_emails );
15281547
}
1548+
1549+
if ( $switched_locale ) {
1550+
restore_previous_locale();
1551+
}
15291552
}
15301553

15311554
/**
@@ -1534,9 +1557,12 @@ protected function send_plugin_theme_email( $type, $successful_updates, $failed_
15341557
* @since 3.7.0
15351558
*/
15361559
protected function send_debug_email() {
1537-
$update_count = 0;
1538-
foreach ( $this->update_results as $type => $updates ) {
1539-
$update_count += count( $updates );
1560+
$admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) );
1561+
1562+
if ( $admin_user ) {
1563+
$switched_locale = switch_to_user_locale( $admin_user->ID );
1564+
} else {
1565+
$switched_locale = switch_to_locale( get_locale() );
15401566
}
15411567

15421568
$body = array();
@@ -1715,6 +1741,10 @@ protected function send_debug_email() {
17151741
$email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
17161742

17171743
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
1744+
1745+
if ( $switched_locale ) {
1746+
restore_previous_locale();
1747+
}
17181748
}
17191749

17201750
/**

src/wp-admin/includes/nav-menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $data_object, $box ) {
875875
}
876876

877877
$num_pages = (int) ceil(
878-
wp_count_terms(
878+
(int) wp_count_terms(
879879
array_merge(
880880
$args,
881881
array(

0 commit comments

Comments
 (0)