Open codebider opened 6 years ago
It's available in the separate request, but I think we can also extend the default post object.
yep. currently, i added this command line
// Posts register_rest_field( 'post', 'number_of_views', array( 'get_callback' => array( $this, 'wp_api_number_of_views' ), 'schema' => null, ) );
It's available in the separate request, but I think we can also extend the default post object.
How it is available in separate request? Can you provide an example?
Can we add number of view to REST API
wp-json/wp/v2/posts