Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gist for my article Building a Gutenberg sidebar plugin Part 5: Outputting data https://vanaf1979.nl/building-a-gutenberg-sidebar-plugin-part-5-outputting-data/
<?php
public function add_metatags_to_head() : void {
global $post;
foreach( $this->metafields as $key => $value ) {
if ( $key == 'title' ) {
continue;
}
$value = \trim( \get_post_meta( $post->ID , $value , true ) );
echo "\t<meta name=\"{$key}\" content=\"{$value}\" />\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment