custom REST endpoint not passing body of POST request to callback
custom REST endpoint not passing body of POST request to callback
custom REST endpoint not passing body of POST request to callback
Custom Rest API namespace and endpoints are responding with 404 & 503 errors
You can try this /* * Increase the limit of posts per page in json */ add_filter( ‘rest_your_collection_params’, function ( $params, WP_Post_Type $post_type ) { if ( ‘your_cpt’ === $post_type->name && isset( $params[‘per_page’] ) ) { $params[‘per_page’][‘maximum’] = 99; } return $params; }, 10, 2 );
So there are two moving parts at work: Domain which web server maps to WP installation Domain WP installation thinks it’s installed on Under normal circumstances these simply match. In your case you have two domains mapped to the installation. WP can only think about one domain at a time. At a time is important … Read more
I am assuming you want these taxonomies data in each item of post_type JSON, but the logic is the same for taxonomies endpoint and JSON response. I see two ways of achieving it. filtering the data using rest_prepare_post_type filter (Reference) or creating new field(s) using the register_rest_field function. (Reference) I would recommend the second approach. … Read more
Can I get programmatic access to wp-admin?
I figured this out, you have to add _embed=1 to any request so: /posts?_embed=1&orderby=date&order=asc for instance. Then it will include an _embeddable key. Annoyingly all the terms come under here so you have to do some extra work to extract the difference between tags and categories etc.
React in plugins: REST endpoints vs. regular functions
Rest API hook ‘rest_insert_post’ not returning request object
WordPress api returns distinct data