Created
July 10, 2022 19:40
-
-
Save dgaitan/2a54d9d9b94a1c1276fd42535032b3eb to your computer and use it in GitHub Desktop.
WordPress Hooks
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 | |
/** | |
* See the next link to understand more about this filter hook. | |
* | |
* @see https://developer.wordpress.org/reference/hooks/the_content/ | |
* @param string $content - the post content. | |
* @return string $content - the content updated | |
*/ | |
function add_footer_to_post_content( $content ) { | |
$content = sprintf( | |
'%s <p>My custom footer</p>', | |
$content | |
); | |
return $content; | |
} | |
add_filter( 'the_content', 'add_footer_to_post_content', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment