ChazUK / wp-api-yoast-meta

Adds the Yoast fields for pages and posts to the WP-API response
105 stars 66 forks source link

Yoas info in categories #2

Closed ebisbe closed 7 years ago

ebisbe commented 7 years ago

Hello,

I've found you plugin really helpfull but I have no clue about wordpress. Do you think there's a way to return yoast info in categories from woocommerce?

ChazUK commented 7 years ago

I can have a look at this, but haven't used WooCommerce before.

ebisbe commented 7 years ago

If you can look it would be awesome but if you can provide some links on what I should be looking in order to understand this issue is fine too. I've found that wordpress has too much info and not all is relevant.

I've tried to modify your plugin adding

        // Posts
        register_api_field( 'post',
            'yoast_meta',
            array(
                'get_callback'    => array( $this, 'wp_api_encode_yoast' ),
                'update_callback' => array( $this, 'wp_api_update_yoast' ),
                'schema'          => null,
            )
        );

changin the value 'post' for 'tax', 'taxonomy', 'term'. But nothings apears on the response.

Poliuk commented 7 years ago

Hey @ebisbe did you find a solution for this? I'm also trying to expose the yoast fields for the categories and post_tags

ebisbe commented 7 years ago

@Poliuk Nope... with the new version of the woocommerce api it exposes for products directly the metadata but it's not working for categories.

Poliuk commented 7 years ago

Thanks @ebisbe! We are talking about this here: https://github.com/ChazUK/wp-api-yoast-meta/issues/3