Skip to content

Commit 30d971c

Browse files
Merge branch 'trunk' into fix/phpstan-undefined-variables
2 parents 8b93b41 + a8fec6f commit 30d971c

14 files changed

Lines changed: 160 additions & 75 deletions

src/wp-admin/css/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ th.action-links {
10861086

10871087
.filter-links .current {
10881088
box-shadow: none;
1089-
border-bottom: 4px solid #646970;
1089+
border-bottom: 4px solid var(--wp-admin-theme-color);
10901090
color: #1d2327;
10911091
}
10921092

src/wp-admin/css/customize-controls.css

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ body:not(.ready) #customize-save-button-wrapper .save {
8383
margin-top: 0;
8484
}
8585

86-
#customize-save-button-wrapper .save:focus, #publish-settings:focus {
87-
box-shadow: 0 1px 0 #2271b1, 0 0 2px 1px #72aee6; /* This is default box shadow for focus */
88-
}
89-
9086
#customize-save-button-wrapper .save.has-next-sibling {
9187
border-radius: 3px 0 0 3px;
9288
}
@@ -499,12 +495,6 @@ body.trashing #publish-settings {
499495
left: 6px;
500496
}
501497

502-
#customize-controls .customize-info.open .customize-help-toggle,
503-
#customize-controls .customize-info .customize-help-toggle:focus,
504-
#customize-controls .customize-info .customize-help-toggle:hover {
505-
color: #2271b1;
506-
}
507-
508498
#customize-controls .customize-info .customize-panel-description,
509499
#customize-controls .customize-info .customize-section-description,
510500
#customize-outer-theme-controls .customize-info .customize-section-description,
@@ -609,15 +599,6 @@ body.trashing #publish-settings {
609599
background: transparent;
610600
}
611601

612-
#customize-controls .control-section:hover > .accordion-section-title,
613-
#customize-controls .control-section .accordion-section-title button:hover,
614-
#customize-controls .control-section.open .accordion-section-title,
615-
#customize-controls .control-section .accordion-section-title button:focus {
616-
color: var(--wp-admin-theme-color, #3858e9);
617-
background: #f6f7f7;
618-
border-left-color: var(--wp-admin-theme-color, #3858e9);
619-
}
620-
621602
#accordion-section-themes + .control-section {
622603
border-top: 1px solid #dcdcde;
623604
}
@@ -629,17 +610,6 @@ body.trashing #publish-settings {
629610
background: #f6f7f7;
630611
}
631612

632-
#customize-theme-controls .control-section:hover > .accordion-section-title:after,
633-
#customize-theme-controls .control-section .accordion-section-title:hover:after,
634-
#customize-theme-controls .control-section.open .accordion-section-title:after,
635-
#customize-theme-controls .control-section .accordion-section-title:focus:after,
636-
#customize-outer-theme-controls .control-section:hover > .accordion-section-title:after,
637-
#customize-outer-theme-controls .control-section .accordion-section-title:hover:after,
638-
#customize-outer-theme-controls .control-section.open .accordion-section-title:after,
639-
#customize-outer-theme-controls .control-section .accordion-section-title:focus:after {
640-
color: #2271b1;
641-
}
642-
643613
#customize-theme-controls .control-section.open {
644614
border-bottom: 1px solid #f0f0f1;
645615
}
@@ -907,8 +877,6 @@ h3.customize-section-title {
907877
.customize-controls-preview-toggle:focus,
908878
.customize-controls-preview-toggle:hover {
909879
background: #fff;
910-
color: #2271b1;
911-
border-top-color: #2271b1;
912880
box-shadow: none;
913881
/* Only visible in Windows High Contrast mode */
914882
outline: 1px solid transparent;
@@ -924,9 +892,7 @@ h3.customize-section-title {
924892
.customize-panel-back:focus,
925893
.customize-section-back:hover,
926894
.customize-section-back:focus {
927-
color: #2271b1;
928895
background: #f6f7f7;
929-
border-left-color: #2271b1;
930896
box-shadow: none;
931897
/* Only visible in Windows High Contrast mode */
932898
outline: 2px solid transparent;
@@ -2033,8 +1999,6 @@ p.customize-section-description {
20331999

20342000
.control-panel-themes .customize-themes-section-title:focus,
20352001
.control-panel-themes .customize-themes-section-title:hover {
2036-
border-left-color: #2271b1;
2037-
color: #2271b1;
20382002
background: #f6f7f7;
20392003
}
20402004

@@ -2063,14 +2027,9 @@ p.customize-section-description {
20632027
position: absolute;
20642028
top: 9px;
20652029
right: 15px;
2066-
background: #2271b1;
20672030
color: #fff;
20682031
}
20692032

2070-
.control-panel-themes .customize-themes-section-title.selected {
2071-
color: #2271b1;
2072-
}
2073-
20742033
#customize-theme-controls .themes.accordion-section-content {
20752034
position: relative;
20762035
left: 0;
@@ -2373,9 +2332,7 @@ p.customize-section-description {
23732332

23742333
.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:hover,
23752334
.wp-customizer .showing-themes .control-panel-themes .customize-themes-mobile-back:focus {
2376-
color: #2271b1;
23772335
background: #f6f7f7;
2378-
border-left-color: #2271b1;
23792336
box-shadow: none;
23802337
/* Only visible in Windows High Contrast mode */
23812338
outline: 2px solid transparent;
@@ -2471,13 +2428,11 @@ p.customize-section-description {
24712428
.wp-customizer .theme-overlay .theme-header .left:focus,
24722429
.wp-customizer .theme-overlay .theme-header .left:hover {
24732430
background: #fff;
2474-
border-bottom: 4px solid #2271b1;
2475-
color: #2271b1;
24762431
}
24772432

24782433
.wp-customizer .theme-overlay .theme-header .close:focus:before,
24792434
.wp-customizer .theme-overlay .theme-header .close:hover:before {
2480-
color: #2271b1;
2435+
color: var(--wp-admin-theme-color);
24812436
}
24822437

24832438
.wp-customizer .theme-overlay .theme-header button.disabled,

src/wp-admin/css/customize-nav-menus.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,
269269
#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,
270270
#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
271-
color: #2271b1;
271+
color: var(--wp-admin-theme-color);
272272
}
273273

274274
.customize-screen-options-toggle:focus,
@@ -836,13 +836,13 @@ li.assigned-to-menu-location .add-new-menu-item {
836836
.menu-item-handle:hover {
837837
position: relative;
838838
z-index: 10;
839-
color: #2271b1;
839+
color: var(--wp-admin-theme-color);
840840
}
841841

842842
.menu-item-handle:hover .item-type,
843843
.menu-item-handle:hover .item-edit,
844844
#available-menu-items .menu-item-handle:hover .item-add {
845-
color: #2271b1;
845+
color: var(--wp-admin-theme-color);
846846
}
847847

848848
.menu-item-edit-active .menu-item-handle {

src/wp-admin/css/customize-widgets.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187

188188
#customize-theme-controls .widget-area-select .selected {
189189
color: #fff;
190-
background: #2271b1;
190+
background: var(--wp-admin-theme-color);
191191
}
192192

193193
#customize-theme-controls .widget-area-select .selected:before {
@@ -245,8 +245,8 @@
245245
#available-widgets .widget-tpl.selected {
246246
background: #f6f7f7;
247247
border-bottom-color: #c3c4c7;
248-
color: #2271b1;
249-
border-left: 4px solid #2271b1;
248+
color: var(--wp-admin-theme-color);;
249+
border-left: 4px solid var(--wp-admin-theme-color);
250250
}
251251

252252
#customize-controls .widget-title h3 {

src/wp-includes/css/admin-bar.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,6 @@ html:lang(he-il) .rtl #wpadminbar * {
596596
top: 3px;
597597
}
598598

599-
#wpadminbar #wp-admin-bar-comments .count-0 {
600-
opacity: .5;
601-
}
602-
603599
/**
604600
* New Content
605601
*/

src/wp-includes/css/customize-preview.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
line-height: 1 !important;
4545
font-size: 18px;
4646
z-index: 5;
47-
background: #3858e9;
47+
background: var( --wp-admin-theme-color, #3858e9 );
4848
border-radius: 50%;
4949
border: 2px solid #fff;
5050
box-shadow: 0 2px 1px rgba(60, 67, 74, 0.15);
@@ -76,11 +76,11 @@
7676
}
7777

7878
.customize-partial-edit-shortcut button:hover {
79-
background: #2145e6 !important; /* matches primary buttons */
79+
background: var( --wp-admin-theme-color-darker-10, #2145e6 ) !important; /* matches primary buttons */
8080
}
8181

8282
.customize-partial-edit-shortcut button:focus {
83-
box-shadow: 0 0 0 1.5px #3858e9;
83+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px ) var(--wp-admin-theme-color, #3858e9);
8484
}
8585

8686
body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button {

src/wp-includes/css/media-views.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,11 @@
10121012
font-weight: 600;
10131013
}
10141014

1015+
/* Do not show the aria-label overlay on thumbnails in the gallery selection strip. */
1016+
.wp-core-ui .media-selection .attachment::after {
1017+
content: none;
1018+
}
1019+
10151020
.wp-core-ui .attachment:focus,
10161021
.wp-core-ui .selected.attachment:focus,
10171022
.wp-core-ui .attachment.details:focus {

src/wp-includes/formatting.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
15661566
* | U+00F6 | ö | oe | Latin small letter o with diaeresis |
15671567
* | U+00DC | Ü | Ue | Latin capital letter U with diaeresis |
15681568
* | U+00FC | ü | ue | Latin small letter u with diaeresis |
1569+
* | U+1E9E | ẞ | SS | Latin capital letter sharp s |
15691570
* | U+00DF | ß | ss | Latin small letter sharp s |
15701571
*
15711572
* Danish (`da_DK`) locale:
@@ -1599,6 +1600,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
15991600
* @since 5.7.0 Added locale support for `de_AT`.
16001601
* @since 6.0.0 Added the `$locale` parameter.
16011602
* @since 6.1.0 Added Unicode NFC encoding normalization support.
1603+
* @since 7.0.0 Added capital Eszett (U+1E9E) support for German locales.
16021604
*
16031605
* @param string $text Text that might have accent characters.
16041606
* @param string $locale Optional. The locale to use for accent removal. Some character
@@ -1972,6 +1974,7 @@ function remove_accents( $text, $locale = '' ) {
19721974
$chars['ö'] = 'oe';
19731975
$chars['Ü'] = 'Ue';
19741976
$chars['ü'] = 'ue';
1977+
$chars[''] = 'SS';
19751978
$chars['ß'] = 'ss';
19761979
} elseif ( 'da_DK' === $locale ) {
19771980
$chars['Æ'] = 'Ae';

src/wp-includes/functions.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,12 +2179,21 @@ function path_join( $base, $path ) {
21792179
* @since 4.4.0 Ensures upper-case drive letters on Windows systems.
21802180
* @since 4.5.0 Allows for Windows network shares.
21812181
* @since 4.9.7 Allows for PHP file wrappers.
2182+
* @since 7.0.0 Uses a static cache to store normalized paths.
21822183
*
21832184
* @param string $path Path to normalize.
21842185
* @return string Normalized path.
21852186
*/
2186-
function wp_normalize_path( $path ) {
2187-
$wrapper = '';
2187+
function wp_normalize_path( $path ): string {
2188+
$path = (string) $path;
2189+
2190+
static $cache = array();
2191+
if ( isset( $cache[ $path ] ) ) {
2192+
return $cache[ $path ];
2193+
}
2194+
2195+
$original_path = $path;
2196+
$wrapper = '';
21882197

21892198
if ( wp_is_stream( $path ) ) {
21902199
list( $wrapper, $path ) = explode( '://', $path, 2 );
@@ -2196,14 +2205,15 @@ function wp_normalize_path( $path ) {
21962205
$path = str_replace( '\\', '/', $path );
21972206

21982207
// Replace multiple slashes down to a singular, allowing for network shares having two slashes.
2199-
$path = preg_replace( '|(?<=.)/+|', '/', $path );
2208+
$path = (string) preg_replace( '|(?<=.)/+|', '/', $path );
22002209

22012210
// Windows paths should uppercase the drive letter.
22022211
if ( ':' === substr( $path, 1, 1 ) ) {
22032212
$path = ucfirst( $path );
22042213
}
22052214

2206-
return $wrapper . $path;
2215+
$cache[ $original_path ] = $wrapper . $path;
2216+
return $cache[ $original_path ];
22072217
}
22082218

22092219
/**

src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,22 @@ public function get_item( $request ) {
197197
public function get_items( $request ) {
198198
$themes = array();
199199

200-
$active_themes = wp_get_themes();
201200
$current_theme = wp_get_theme();
202201
$status = $request['status'];
203202

204-
foreach ( $active_themes as $theme ) {
205-
$theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive';
206-
if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) {
207-
continue;
208-
}
209-
210-
$prepared = $this->prepare_item_for_response( $theme, $request );
203+
if ( array( 'active' ) === $status ) {
204+
$prepared = $this->prepare_item_for_response( $current_theme, $request );
211205
$themes[] = $this->prepare_response_for_collection( $prepared );
206+
} else {
207+
foreach ( wp_get_themes() as $theme ) {
208+
$theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive';
209+
if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) {
210+
continue;
211+
}
212+
213+
$prepared = $this->prepare_item_for_response( $theme, $request );
214+
$themes[] = $this->prepare_response_for_collection( $prepared );
215+
}
212216
}
213217

214218
$response = rest_ensure_response( $themes );

0 commit comments

Comments
 (0)