How to run select query of post with category and tags for API?
WordPress already has an API you can extend, and a class for querying posts! For example: // when the rest_api_init action/event happens add_action( ‘rest_api_init’, function () { // register a new endpoint register_rest_route( ‘mohnish/v1’, ‘/posts/’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘mohnish_awesome_func’, // that calls this function ) ); } ); // this is whats … Read more