Yoast / yoast-acf-analysis

WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
GNU General Public License v3.0
61 stars 20 forks source link

How to add custom image fields to Yoast Content Analysis #378

Open xanghyr opened 1 week ago

xanghyr commented 1 week ago

Please give us a description of what happened.

I am using the plugin "Advanced Custom Fields: Image Aspect Ratio Crop" which adds a new field type "image_aspect_ratio_crop" to ACF. So this is still an image, but Yoast Content Analysis does not detect it.

As all my images are with "image_aspect_ratio_crop" I have the Analysis alert "No images appear on this page.". If I use a classic ACF "image" field the alert is gone, so this is it.

Please describe what you expected to happen and why.

I just want a way to tell Yoast "Consider this as an image". I tried this :

add_filter( 'Yoast\WP\ACF\field_selectors', function ( $field_selectors ) {
    $field_selectors->add( '.acf-image-uploader-aspect-ratio-crop input[type=hidden]' );
    return $field_selectors;
});

But this does nothing. I don't know how to do this.

Technical info