Block Editor: Send locale, version with remote pattern requests.
This information is needed by the w.org API for translation and caching. Props dd32, ryelle, tellyworth See #53435 Built from https://develop.svn.wordpress.org/trunk@51206 git-svn-id: http://core.svn.wordpress.org/trunk@50815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0a2b52dfeb
commit
0f249041f9
|
@ -83,7 +83,18 @@ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller {
|
|||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
*/
|
||||
public function get_items( $request ) {
|
||||
$query_args = array();
|
||||
/*
|
||||
* Include an unmodified `$wp_version`, so the API can craft a response that's tailored to
|
||||
* it. Some plugins modify the version in a misguided attempt to improve security by
|
||||
* obscuring the version, which can cause invalid requests.
|
||||
*/
|
||||
require ABSPATH . WPINC . '/version.php';
|
||||
|
||||
$query_args = array(
|
||||
'locale' => get_user_locale(),
|
||||
'wp-version' => $wp_version,
|
||||
);
|
||||
|
||||
$category_id = $request['category'];
|
||||
$keyword_id = $request['keyword'];
|
||||
$search_term = $request['search'];
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-beta2-51205';
|
||||
$wp_version = '5.8-beta2-51206';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue