function register_yoast_seo_rest_fields() { // Register Yoast SEO Title for access in REST API register_rest_field( 'post', '_yoast_wpseo_title', [ 'get_callback' => 'get_yoast_seo_rest_field', 'update_callback' => 'update_yoast_seo_rest_field', 'schema' => null, ]); // Register Yoast SEO Meta Description for access in REST API register_rest_field( 'post', '_yoast_wpseo_metadesc', [ 'get_callback' => 'get_yoast_seo_rest_field', 'update_callback' => 'update_yoast_seo_rest_field', 'schema' => null, ]); } add_action( 'rest_api_init', 'register_yoast_seo_rest_fields' ); function get_yoast_seo_rest_field( $object, $field_name, $request ) { return get_post_meta( $object['id'], $field_name, true ); } function update_yoast_seo_rest_field( $value, $post, $field_name, $request, $object_type ) { if ( ! $value || ! is_string( $value ) ) { return; } return update_post_meta( $post->ID, $field_name, sanitize_text_field( $value ) ); }

Our latest news: Discover Microsoft Fabric. Read

News

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.Lorem ipsum dolor sit amet, consectetur adipiscing elit. 

Discover Microsoft Fabric

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo...

Discover Microsoft Fabric #2 #2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo...

Discover Microsoft Fabric #2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo...