Support » Plugin: WP API Yoast SEO » Suggestion

  • Thank you for your plugin.
    I think it will work better if you change wp_api_encode_yoast to something like:

        function wp_api_encode_yoast($post_t, $field_name, $request) {
            global $post;
            $wpseo = WPSEO_Frontend::get_instance();
            $yoastMeta = array(
                'focuskw' => get_post_meta($post_t['id'],'_yoast_wpseo_focuskw', true),
                'title' => $wpseo->get_content_title($post),
                'metadesc' => get_post_meta($post_t['id'], '_yoast_wpseo_metadesc', true),
                'linkdex' => get_post_meta($post_t['id'], '_yoast_wpseo_linkdex', true),
                'metakeywords' => get_post_meta($post_t['id'], '_yoast_wpseo_metakeywords', true),
                'meta-robots-noindex' => get_post_meta($post_t['id'], '_yoast_wpseo_meta-robots-noindex', true),
                'meta-robots-nofollow' => get_post_meta($post_t['id'], '_yoast_wpseo_meta-robots-nofollow', true),
                'meta-robots-adv' => get_post_meta($post_t['id'], '_yoast_wpseo_meta-robots-adv', true),
                'canonical' => get_post_meta($post_t['id'], '_yoast_wpseo_canonical', true),
                'redirect' => get_post_meta($post_t['id'], '_yoast_wpseo_redirect', true),
                'opengraph-title' => get_post_meta($post_t['id'], '_yoast_wpseo_opengraph-title', true),
                'opengraph-description' => get_post_meta($post_t['id'], '_yoast_wpseo_opengraph-description', true),
                'opengraph-image' => get_post_meta($post_t['id'], '_yoast_wpseo_opengraph-image', true),
                'twitter-title' => get_post_meta($post_t['id'], '_yoast_wpseo_twitter-title', true),
                'twitter-description' => get_post_meta($post_t['id'], '_yoast_wpseo_twitter-description', true),
                'twitter-image' => get_post_meta($post_t['id'], '_yoast_wpseo_twitter-image', true)
            );
    
            return (array) $yoastMeta;
        }

    and then ask Team Yoast to change their plugin, function get_title_from_options file class-frontend.php line 312 to something like:
    if ( is_singular() || array_key_exists( 'post_title', $var_source )) ) {

    • This topic was modified 5 years, 7 months ago by dkurilo.
Viewing 1 replies (of 1 total)
  • Can someone explain what this plugin does and how it works?

    I came here looking for plugin to add SEO output to my posts/pages.

    thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion’ is closed to new replies.