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 ) ); }
Yukii Creatives
Copyright 2023

BR AND ING

Inspiration
Boldnesss
Vision
Creativity

PHO TO GRA PHY

Feelings
Intesity
Vibes
Ecstasy

BR AND ING

Inspiration
Boldnesss
Vision
Creativity

PHO
TO
GRA
PHY

Feelings
Intesity
Vibes
Ecstasy
Yukii Creatives
Copyright 2023