Skip to content

Instantly share code, notes, and snippets.

@zebrastribe
Created April 12, 2021 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zebrastribe/0209e6133381b5718afc31b968c52f21 to your computer and use it in GitHub Desktop.
Save zebrastribe/0209e6133381b5718afc31b968c52f21 to your computer and use it in GitHub Desktop.
Person Schema Yoast
add_filter( 'wpseo_schema_person', 'example_change_person' );
function example_change_person( $data ) {
$user_id = ??;
// data
$author_avatar = get_avatar_url('john@doe.com');
$data['name'] = "John Doe";
$data['author']['name'] = "John Doe";
$data['image']['caption'] = "John Doe";
$data['image']['url'] = $author_avatar;
$data['@id'] = $user_id;
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment