WordPress + REST API + featured_image
WordPress + REST API + featured_image
WordPress + REST API + featured_image
Rest Api Error ‘ Error: {‘code’: ‘rest_no_route’, ‘message’: ‘No route was found matching the URL and request method.’, ‘data’: {‘status’: 404}}@ [closed]
You can access another database using the wpdb class and its associated methods. You will need to instantiate a new connection to the other database using the appropriate credentials. Here is the basic code to set up the new connection and query the database: $mydb = new wpdb(‘username’,’password’,’database’,’localhost’); $rows = $mydb->get_results(“<your SQL query here>”); Replace … Read more
How can I enforce user to use Application password to generate JWT token? [closed]
What you are trying to do is not something that endpoint is capable of. You can create attachments, you can even rotate and crop the file, but you cannot replace the attached file. When cropping/scaling/rotating an image, a new attachment and ID are created for the newly edited image. However, sending an UPDATE/PUT/POST request to … Read more
You were on the right track with the second try. Put this is functions.php, or wherever: if (!wp_next_scheduled(‘fetch_webcategories_hook’)) { wp_schedule_event( time(), ‘hourly’, ‘fetch_webcategories_hook’ ); } add_action ( ‘fetch_webcategories_hook’, ‘fetch_webcategories’ ); It’s not quite a real hourly schedule because somebody has to visit the site to trigger it, so if you have VERY low traffic it … Read more
Because what you’re trying to do boils down to the fundamental question: How do I log in to WordPress using only the REST API? The answer: You can’t in stock/vanilla WordPress. /wp-json/wp/v2/users/me/application-passwords/ “message”: “You are not currently logged in.”, and /wp-json/wp/v2/users/1/application-passwords/ “message”: “Sorry, you are not allowed to create application passwords for this user.”, Are … Read more
For all REST API routes, the rest_api_init action hook fires when preparing to serve a REST API request. The request URI ($_SERVER[‘REQUEST_URI’]) can be inspected with a regular expression to detect the root (e.g. wp-json) and the route (e.g. /wp/v2/posts) of the request. You can then decide what to return to the client (e.g. WP_Error, … Read more
How to boost WP custom post REST API GET queries by custom taxonomies
I managed to solve the issue, as the SEARCH EVERYTHING plugin has this exact functionality. The issue was not related to WP-REST, but to the standard WordPress Search.