Skip to content

Commit 83029dd

Browse files
authored
Merge branch 'trunk' into ticket/61996-fix-slug-conflict
2 parents e3f0b0e + 54593bc commit 83029dd

4 files changed

Lines changed: 108 additions & 109 deletions

File tree

src/wp-admin/css/common.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,22 +1473,22 @@ div.error p,
14731473
color: #1e1e1e;
14741474
}
14751475

1476-
.notice a,
1477-
.error a,
1478-
.updated a {
1476+
div.notice a,
1477+
div.error a,
1478+
div.updated a {
14791479
color: var(--wp-admin-theme-color-darker-10);
14801480
text-decoration: underline;
14811481
}
14821482

1483-
.notice a:hover,
1484-
.error a:hover,
1485-
.updated a:hover {
1483+
div.notice a:hover,
1484+
div.error a:hover,
1485+
div.updated a:hover {
14861486
color: var(--wp-admin-theme-color-darker-20);
14871487
}
14881488

1489-
.notice a:focus,
1490-
.error a:focus,
1491-
.updated a:focus {
1489+
div.notice a:focus,
1490+
div.error a:focus,
1491+
div.updated a:focus {
14921492
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
14931493
outline: 2px solid transparent;
14941494
border-radius: 2px;

src/wp-includes/class-wp-block-patterns-registry.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,9 @@ public function get_registered( $pattern_name ) {
227227
* and per style.
228228
*/
229229
public function get_all_registered( $outside_init_only = false ) {
230-
$patterns = $outside_init_only
231-
? $this->registered_patterns_outside_init
232-
: $this->registered_patterns;
233-
$hooked_blocks = get_hooked_blocks();
230+
$patterns = $outside_init_only
231+
? $this->registered_patterns_outside_init
232+
: $this->registered_patterns;
234233

235234
foreach ( $patterns as $index => $pattern ) {
236235
$content = $this->get_content( $pattern['name'], $outside_init_only );

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
.media-frame a:focus {
5757
border-radius: 2px;
5858
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
59-
color: #043959;
59+
color: var(--wp-admin-theme-color-darker-20, #183ad6);
6060
/* Only visible in Windows High Contrast mode */
6161
outline: 2px solid transparent;
6262
}
@@ -244,13 +244,13 @@
244244

245245
.media-modal-close:hover,
246246
.media-modal-close:active {
247-
color: #135e96;
247+
color: var(--wp-admin-theme-color, #3858e9);
248248
}
249249

250250
.media-modal-close:focus {
251-
color: #135e96;
252-
border-color: #4f94d4;
253-
box-shadow: 0 0 3px rgba(34, 113, 177, 0.8);
251+
color: var(--wp-admin-theme-color, #3858e9);
252+
border-color: var(--wp-admin-theme-color, #3858e9);
253+
box-shadow: 0 0 3px rgba(var(--wp-admin-theme-color--rgb, 56, 88, 233), 0.8);
254254
/* Only visible in Windows High Contrast mode */
255255
outline: 2px solid transparent;
256256
}
@@ -673,7 +673,7 @@
673673
font-size: 14px;
674674
line-height: 1.28571428;
675675
background: transparent;
676-
color: #2271b1;
676+
color: var(--wp-admin-theme-color, #3858e9);
677677
text-align: left;
678678
text-decoration: none;
679679
cursor: pointer;
@@ -684,7 +684,7 @@
684684
}
685685

686686
.media-menu .media-menu-item:active {
687-
color: #2271b1;
687+
color: var(--wp-admin-theme-color, #3858e9);
688688
outline: none;
689689
}
690690

@@ -696,7 +696,7 @@
696696

697697
.media-menu .media-menu-item:focus {
698698
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
699-
color: #043959;
699+
color: var(--wp-admin-theme-color-darker-20, #183ad6);
700700
/* Only visible in Windows High Contrast mode */
701701
outline: 2px solid transparent;
702702
}
@@ -739,7 +739,7 @@
739739

740740
.media-router .media-menu-item:hover,
741741
.media-router .media-menu-item:active {
742-
color: #2271b1;
742+
color: var(--wp-admin-theme-color, #3858e9);
743743
}
744744

745745
.media-router .active,
@@ -749,7 +749,7 @@
749749

750750
.media-router .media-menu-item:focus {
751751
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
752-
color: #043959;
752+
color: var(--wp-admin-theme-color-darker-20, #183ad6);
753753
/* Only visible in Windows High Contrast mode */
754754
outline: 2px solid transparent;
755755
z-index: 1;
@@ -1321,8 +1321,8 @@
13211321
}
13221322

13231323
.uploader-inline .close:focus {
1324-
outline: 1px solid #4f94d4;
1325-
box-shadow: 0 0 3px rgba(34, 113, 177, 0.8);
1324+
outline: 1px solid var(--wp-admin-theme-color, #3858e9);
1325+
box-shadow: 0 0 3px rgba(var(--wp-admin-theme-color--rgb, 56, 88, 233), 0.8);
13261326
}
13271327

13281328
.attachments-browser.hide-sidebar .attachments,
@@ -1409,7 +1409,7 @@
14091409
height: 10px;
14101410
min-width: 20px;
14111411
width: 0;
1412-
background: #2271b1;
1412+
background: var(--wp-admin-theme-color, #3858e9);
14131413
border-radius: 10px;
14141414
transition: width 300ms;
14151415
}
@@ -1527,7 +1527,7 @@
15271527

15281528
.uploader-window,
15291529
.wp-editor-wrap .uploader-editor.droppable {
1530-
background: rgba(10, 75, 120, 0.9);
1530+
background-color: rgba(var(--wp-admin-theme-color--rgb, 56, 88, 233), 0.9);
15311531
}
15321532

15331533
.uploader-window-content,
@@ -1688,13 +1688,13 @@
16881688
margin: 1px 8px 1px -8px;
16891689
line-height: 1.4;
16901690
border-right: 1px solid #dcdcde;
1691-
color: #2271b1;
1691+
color: var(--wp-admin-theme-color, #3858e9);
16921692
text-decoration: none;
16931693
}
16941694

16951695
.media-selection .button-link:hover,
16961696
.media-selection .button-link:focus {
1697-
color: #135e96;
1697+
color: var(--wp-admin-theme-color-darker-20, #183ad6);
16981698
}
16991699

17001700
.media-selection .button-link:last-child {
@@ -1752,7 +1752,7 @@
17521752
.wp-core-ui .media-selection .attachment.details:focus {
17531753
box-shadow:
17541754
0 0 0 1px #fff,
1755-
0 0 2px 3px #4f94d4;
1755+
0 0 2px 3px var(--wp-admin-theme-color, #3858e9);
17561756
/* Only visible in Windows High Contrast mode */
17571757
outline: 2px solid transparent;
17581758
}
@@ -1764,7 +1764,7 @@
17641764
.wp-core-ui .media-selection .attachment.details {
17651765
box-shadow:
17661766
0 0 0 1px #fff,
1767-
0 0 0 3px #2271b1;
1767+
0 0 0 3px var(--wp-admin-theme-color, #3858e9);
17681768
}
17691769

17701770
.media-selection:after {
@@ -2044,7 +2044,7 @@
20442044
margin: 0;
20452045
padding: 0;
20462046
background: transparent;
2047-
color: #2271b1;
2047+
color: var(--wp-admin-theme-color, #3858e9);
20482048
font-size: 20px;
20492049
line-height: 1;
20502050
cursor: pointer;
@@ -2053,9 +2053,9 @@
20532053
}
20542054

20552055
.wp-core-ui.media-modal .image-editor .imgedit-help-toggle:focus {
2056-
color: #2271b1;
2057-
border-color: #2271b1;
2058-
box-shadow: 0 0 0 1px #2271b1;
2056+
color: var(--wp-admin-theme-color, #3858e9);
2057+
border-color: var(--wp-admin-theme-color, #3858e9);
2058+
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #3858e9);
20592059
/* Only visible in Windows High Contrast mode */
20602060
outline: 2px solid transparent;
20612061
}

tests/phpunit/tests/rest-api/rest-server.php

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,21 @@ public function test_envelope_param( $_embed ) {
151151
$this->assertSame( $headers, $enveloped['headers'] );
152152
}
153153

154+
/**
155+
* Data provider.
156+
*
157+
* @return array
158+
*/
159+
public function data_envelope_params() {
160+
return array(
161+
array( '1' ),
162+
array( 'true' ),
163+
array( false ),
164+
array( 'alternate' ),
165+
array( array( 'alternate' ) ),
166+
);
167+
}
168+
154169
public function test_default_param() {
155170

156171
register_rest_route(
@@ -1721,6 +1736,32 @@ public function test_rest_send_refreshed_nonce_invalid_nonce() {
17211736
$this->assertArrayNotHasKey( 'X-WP-Nonce', $headers );
17221737
}
17231738

1739+
/**
1740+
* Helper to setup a users and auth cookie global for the
1741+
* rest_send_refreshed_nonce related tests.
1742+
*/
1743+
protected function helper_setup_user_for_rest_send_refreshed_nonce_tests() {
1744+
$author = self::factory()->user->create( array( 'role' => 'author' ) );
1745+
wp_set_current_user( $author );
1746+
1747+
global $wp_rest_auth_cookie;
1748+
1749+
$wp_rest_auth_cookie = true;
1750+
}
1751+
1752+
/**
1753+
* Helper to make the request and get the headers for the
1754+
* rest_send_refreshed_nonce related tests.
1755+
*
1756+
* @return array
1757+
*/
1758+
protected function helper_make_request_and_return_headers_for_rest_send_refreshed_nonce_tests() {
1759+
$request = new WP_REST_Request( 'GET', '/', array() );
1760+
$result = rest_get_server()->serve_request( '/' );
1761+
1762+
return rest_get_server()->sent_headers;
1763+
}
1764+
17241765
/**
17251766
* Refreshed nonce should be present in header when a valid nonce is
17261767
* passed for logged in/anonymous user and not present when nonce is not
@@ -1751,6 +1792,23 @@ public function test_rest_send_refreshed_nonce( $has_logged_in_user, $has_nonce
17511792
}
17521793
}
17531794

1795+
/**
1796+
* @return array {
1797+
* @type array {
1798+
* @type bool $has_logged_in_user Are we registering a user for the test.
1799+
* @type bool $has_nonce Is the nonce passed.
1800+
* }
1801+
* }
1802+
*/
1803+
public function data_rest_send_refreshed_nonce() {
1804+
return array(
1805+
array( true, true ),
1806+
array( true, false ),
1807+
array( false, true ),
1808+
array( false, false ),
1809+
);
1810+
}
1811+
17541812
/**
17551813
* Make sure that a sanitization that transforms the argument type will not
17561814
* cause the validation to fail.
@@ -1790,6 +1848,22 @@ public function test_rest_validate_before_sanitization() {
17901848
$this->assertSame( 200, $response->get_status() );
17911849
}
17921850

1851+
public function _validate_as_integer_123( $value, $request, $key ) {
1852+
if ( ! is_int( $value ) ) {
1853+
return new WP_Error( 'some-error', 'This is not valid!' );
1854+
}
1855+
1856+
return true;
1857+
}
1858+
1859+
public function _validate_as_string_foo( $value, $request, $key ) {
1860+
if ( ! is_string( $value ) ) {
1861+
return new WP_Error( 'some-error', 'This is not valid!' );
1862+
}
1863+
1864+
return true;
1865+
}
1866+
17931867
/**
17941868
* @ticket 43691
17951869
*/
@@ -2637,78 +2711,4 @@ public function test_prefers_developer_defined_target_hints() {
26372711
$this->assertArrayHasKey( 'allow', $link['targetHints'] );
26382712
$this->assertSame( array( 'GET', 'PUT' ), $link['targetHints']['allow'] );
26392713
}
2640-
2641-
public function _validate_as_integer_123( $value, $request, $key ) {
2642-
if ( ! is_int( $value ) ) {
2643-
return new WP_Error( 'some-error', 'This is not valid!' );
2644-
}
2645-
2646-
return true;
2647-
}
2648-
2649-
public function _validate_as_string_foo( $value, $request, $key ) {
2650-
if ( ! is_string( $value ) ) {
2651-
return new WP_Error( 'some-error', 'This is not valid!' );
2652-
}
2653-
2654-
return true;
2655-
}
2656-
2657-
/**
2658-
* @return array {
2659-
* @type array {
2660-
* @type bool $has_logged_in_user Are we registering a user for the test.
2661-
* @type bool $has_nonce Is the nonce passed.
2662-
* }
2663-
* }
2664-
*/
2665-
public function data_rest_send_refreshed_nonce() {
2666-
return array(
2667-
array( true, true ),
2668-
array( true, false ),
2669-
array( false, true ),
2670-
array( false, false ),
2671-
);
2672-
}
2673-
2674-
/**
2675-
* Helper to setup a users and auth cookie global for the
2676-
* rest_send_refreshed_nonce related tests.
2677-
*/
2678-
protected function helper_setup_user_for_rest_send_refreshed_nonce_tests() {
2679-
$author = self::factory()->user->create( array( 'role' => 'author' ) );
2680-
wp_set_current_user( $author );
2681-
2682-
global $wp_rest_auth_cookie;
2683-
2684-
$wp_rest_auth_cookie = true;
2685-
}
2686-
2687-
/**
2688-
* Helper to make the request and get the headers for the
2689-
* rest_send_refreshed_nonce related tests.
2690-
*
2691-
* @return array
2692-
*/
2693-
protected function helper_make_request_and_return_headers_for_rest_send_refreshed_nonce_tests() {
2694-
$request = new WP_REST_Request( 'GET', '/', array() );
2695-
$result = rest_get_server()->serve_request( '/' );
2696-
2697-
return rest_get_server()->sent_headers;
2698-
}
2699-
2700-
/**
2701-
* Data provider.
2702-
*
2703-
* @return array
2704-
*/
2705-
public function data_envelope_params() {
2706-
return array(
2707-
array( '1' ),
2708-
array( 'true' ),
2709-
array( false ),
2710-
array( 'alternate' ),
2711-
array( array( 'alternate' ) ),
2712-
);
2713-
}
27142714
}

0 commit comments

Comments
 (0)