How can I get the media inside a post?
How can I get the media inside a post?
How can I get the media inside a post?
Erratic OAuth 1.0 Signature Mismatch Errors
I had to add this code from Stephen Mullen on StackOverflow to get it to work: add_action( “rest_insert_user_question”, function ( \WP_Post $post, $request, $creating ) { $metas = $request->get_param( “meta” ); if( is_array( $metas ) ) { foreach( $metas as $name => $value ) { // update_post_meta( $post->ID, $name, $value ); update_field( $name, $value, $post->ID … Read more
rest_sanitize_value_from_schema doesn’t sanitize string
No ‘Access-Control-Allow-Origin’ header is present [closed]
Instead of using wp_ajax_ (i.e. admin-ajax.php), how about adding a custom REST API field and then using its update_callback, download the remote image and set it as the post featured image? Working Example add_action( ‘rest_api_init’, ‘wpse_381217’ ); function wpse_381217() { register_rest_field( ‘post’, ‘featured_image_url’, array( // If you don’t want to expose the field in the … Read more
Setting maintenance mode via REST API
Custom Post Type and Custom REST API Endpoint result in Gutenberg editor not working
How to upload Woocommerce product images via API? [closed]
That’s strange, but nonetheless, you should know that whether you use cURL, PHP, JS, etc., if you’re sending a JSON data, then you should set the Content-Type header to application/json. And via the cURL command line, you can use the -H option: curl –user “username:password” -X POST \ -H “Content-Type: application/json” \ -i https://example.com/wp-json/wp/v2/posts \ … Read more