How to include Yoast SEO data in WordPress Custom Endpoint
I have a custom endpoint created following the official guide and in it, I'm simply fetching the post by slug (name) as follows: if ( $posts = get_posts( array( 'name' => $slug, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' =>…