@wordpress/e2e-tests 9.18.0 → 9.19.1-next.v.202608281122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-tests",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.19.1-next.v.202608281122.0",
|
|
4
4
|
"description": "Test plugins and mu-plugins for E2E tests in WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"npm": ">=8.19.2"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@wordpress/interactivity": "^6.
|
|
28
|
-
"@wordpress/interactivity-router": "^2.
|
|
27
|
+
"@wordpress/interactivity": "^6.54.1-next.v.202608281122.0",
|
|
28
|
+
"@wordpress/interactivity-router": "^2.54.1-next.v.202608281122.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"y-websocket": "^3.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "de479d415171765f7b573c81aeec5334ff506a12"
|
|
42
42
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: Gutenberg Test Plugin, Hide User REST Routes
|
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
5
|
+
* Author: Gutenberg Team
|
|
6
|
+
*
|
|
7
|
+
* @package gutenberg-test-hide-user-rest-routes
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Removes the main Users REST routes for requests carrying the test cookie.
|
|
12
|
+
* Application Password routes remain registered, matching sites that hide
|
|
13
|
+
* public user profiles while keeping application authentication available.
|
|
14
|
+
*
|
|
15
|
+
* @param array $endpoints Registered REST endpoints.
|
|
16
|
+
* @return array Filtered REST endpoints.
|
|
17
|
+
*/
|
|
18
|
+
function gutenberg_test_hide_user_rest_routes( $endpoints ) {
|
|
19
|
+
$hide_user_routes = isset( $_COOKIE['gutenberg_test_hide_user_rest_routes'] )
|
|
20
|
+
? sanitize_text_field( wp_unslash( $_COOKIE['gutenberg_test_hide_user_rest_routes'] ) )
|
|
21
|
+
: '';
|
|
22
|
+
|
|
23
|
+
if ( '1' !== $hide_user_routes ) {
|
|
24
|
+
return $endpoints;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
foreach ( array_keys( $endpoints ) as $route ) {
|
|
28
|
+
if (
|
|
29
|
+
str_starts_with( $route, '/wp/v2/users' ) &&
|
|
30
|
+
! str_contains( $route, '/application-passwords' )
|
|
31
|
+
) {
|
|
32
|
+
unset( $endpoints[ $route ] );
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return $endpoints;
|
|
37
|
+
}
|
|
38
|
+
add_filter( 'rest_endpoints', 'gutenberg_test_hide_user_rest_routes' );
|
|
@@ -88,4 +88,22 @@
|
|
|
88
88
|
icon: 'text',
|
|
89
89
|
render: MySidebarPlugin,
|
|
90
90
|
} );
|
|
91
|
+
|
|
92
|
+
// A pinnable sidebar without a PluginSidebarMoreMenuItem of its own, so the
|
|
93
|
+
// only More Menu item for it is the one PluginSidebar injects.
|
|
94
|
+
function MyInjectedItemSidebarPlugin() {
|
|
95
|
+
return el(
|
|
96
|
+
PluginSidebar,
|
|
97
|
+
{
|
|
98
|
+
name: 'injected-item-sidebar',
|
|
99
|
+
title: __( 'Injected menu item' ),
|
|
100
|
+
},
|
|
101
|
+
el( PanelBody, {}, __( 'Injected menu item content' ) )
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
registerPlugin( 'my-injected-item-sidebar-plugin', {
|
|
106
|
+
icon: 'text',
|
|
107
|
+
render: MyInjectedItemSidebarPlugin,
|
|
108
|
+
} );
|
|
91
109
|
} )();
|