How do I filter Child Posts by Parent Post ID for Custom Post types in WordPress REST API response?
I’d start out by checking that your request is being passed properly. I’d do that by changing this: function custom_api_get_all_posts_callback( $request ) { // Initialize the array that will receive the posts’ data. $posts_data = array(); to this: function custom_api_get_all_posts_callback( $request ) { // Initialize the array that will receive the posts’ data. echo “<pre>”; … Read more