Hello! Sorry for my belated reply.
You can find the filters for images here: https://tsf.fyi/docs/api/filters#image-related.
Since the images are obtained via a PHP generator for improved performance, you require two methods: One to register the generator, and the generator itself. I understand it gets tricky, so here’s a template adjusted for your needs. You need to adjust my_author_image_field
to your image field name:
add_filter( 'the_seo_framework_image_generation_params', function( $params = [], $args = null, $context = 'social' ) {
// Let's not mess with non-social sharing images.
if ( 'social' !== $context ) return $params;
if ( null === $args ) {
// In the loop.
if ( is_author() ) {
// Prepend our most generator, so it'll run first.
$params['cbs'] = array_merge(
[ 'custom_author' => 'my_tsf_custom_author_image_generator' ],
$params['cbs']
);
}
}
return $params;
}, 10, 3 );
function my_tsf_custom_author_image_generator( $args = null, $size = 'full' ) {
$url = function_exists( 'get_field' ) ? get_field( 'my_author_image_field', tsf()->get_the_real_ID() ) : '';
$id = 0; // Got an ID? Put it here to allow further parsing.
if ( $url ) {
yield [
'url' => $url,
'id' => $id, // Optional. Used for alt-tag fetching and dimension testing.
];
}
}