Last active
August 29, 2015 14:25
-
-
Save daronspence/bb24086c10a739ffd239 to your computer and use it in GitHub Desktop.
Rendering post meta from a plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_content', function( $content ){ | |
$extra_content = get_post_meta( 'extra_content', $post->ID ); | |
if ( ! empty($extra_content ) ) | |
return $content . $extra_content ; | |
else | |
return $content; | |
}, 10, 1 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment