acf/schema/auto_add_image
Filter whether to automatically add featured image to JSON-LD output
Usage
add_filter( 'acf/schema/auto_add_image', 'wp_kama_acf_schema_auto_add_image_filter', 10, 3 );
/**
* Function for `acf/schema/auto_add_image` filter-hook.
*
* @param bool $add_image Whether to add the featured image.
* @param WP_Post $post The post object.
* @param string $post_type The post type.
*
* @return bool
*/
function wp_kama_acf_schema_auto_add_image_filter( $add_image, $post, $post_type ){
// filter...
return $add_image;
}
- $add_image(true|false)
- Whether to add the featured image.
Default: true - $post(WP_Post)
- The post object.
- $post_type(string)
- The post type.
Where the hook is called
acf/schema/auto_add_image
acf/src/AI/GEO/Outputs/Posts.php 204
$add_image = apply_filters( 'acf/schema/auto_add_image', true, $post, $post_type );