Skip to content

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

@xanghyr

Description

@xanghyr
  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions