Error 500 if _embed=1 parameter is provided
-
In our site I’ve checked that
_embed=1
parameter is added to the REST API URL, a fatal error is generated:PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::get_matched_route() in /var/www/html_dev5/wp-includes/rest-api.php:765 Stack trace: #0 /var/www/html_dev5/wp-includes/class-wp-hook.php(303): rest_send_allow_header(Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request)) #1 /var/www/html_dev5/wp-includes/plugin.php(189): WP_Hook->apply_filters(Object(WP_Error), Array) #2 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(701): apply_filters('rest_post_dispa...', Object(WP_Error), Object(WP_REST_Server), Object(WP_REST_Request)) #3 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(551): WP_REST_Server->embed_links(Array, true) #4 /var/www/html_dev5/wp-includes/rest-api/class-wp-rest-server.php(474): WP_REST_Server->response_to_data(Object(WP_REST_Response), true) #5 /var/www/html_dev5/wp-includes/rest-api.php(370): WP_REST_Server->serve_request('/wp/v2/posts') #6 /var/www/html_dev5/wp-includes/class-wp-hook.php(303): rest_api_loaded(Object(WP)) #7 /var/www/html_dev5/wp-i in /var/www/html_dev5/wp-includes/rest-api.php on line 765
For example, the URL that generates the error is:
/wp-json/wp/v2/posts?_embed=1&post_type=post:page&per_page=6&search=blog
If I deactivate the REST API Toolbox plugin, that call returns the corresponding posts without any problem.
Also, the call:
/wp-json/wp/v2/posts?post_type=post:page&per_page=6&search=blog
works correctly without deactivating the plugin.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Error 500 if _embed=1 parameter is provided’ is closed to new replies.