WordPress 5 WP REST routes – No errors

REST API should always return JSON, so it’s output can be parsed as such. If it’ll return something that is not correct JSON, then your JS scripts may stop working. This is why there should be no errors printed in these requests – such messages break JSON response and make it hard to parse. And … Read more

REST : how do you handle the rest_no_route error?

I dug in the codex and found some interesting functions. This is how I finally did it : function api_request($api_url = null, $params=null,$method = ‘GET’){ if (!$api_url){ return new WP_Error(‘no_api_url’,”Missing API URL”); } //Create request $request = WP_REST_Request::from_url( $api_url ); //Method $request->set_method( $method ); //params switch($method){ case ‘GET’: $request->set_query_params($params); break; case ‘POST’: $request->set_body_params($params); break; } … Read more

Warning: Declaration of QuietSkin::feedback error

If anyone encounters this warning and cannot hide it with changing the line in wp-config.php from true to false , replace define(‘WP_DEBUG’, false); or define(‘WP_DEBUG’, true); with this : ini_set(‘display_errors’,’Off’); ini_set(‘error_reporting’, E_ALL ); define(‘WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false); It helped me, so I hope it will help you also 😉

Post-terms-order PHP errors after update

Welcome! This PHP warning is related to the new update of WordPress (5.3) which had a change in Walker class. Previously the walker method had 2 arguments. In the new update, it has more arguments. In order to fix the issue, You need to change the code from Post_Terms_Order_Walker::walk($elements, $max_depth) to Post_Terms_Order_Walker::walk($elements, $max_depth, …$args) Note: … Read more

WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files

As discussed in comments, the problem was that the site address was set to localhost:8888/myBlog. This is the URL WordPress is expecting your clients to be using, and uses this to generate fully-qualified URLs for scripts and CSS etc. Hence your other clients were trying to load scripts and CSS from their own localhost. The … Read more

media_buttons_context is deprecated

Try this media_buttons instead of media_buttons_context Please refer these URL: https://developer.wordpress.org/reference/hooks/media_buttons_context/ https://developer.wordpress.org/reference/hooks/media_buttons/