Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Gist for my article Building a Gutenberg sidebar plugin Part 5: Outputting data
public function add_title_to_head( String $title ) : string {
global $post;
$title = \trim( \get_post_meta( $post->ID , 'metatags_browser_title' , true ) );
return $title > '' ? $title : $post->post_title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment