Skip to content

Instantly share code, notes, and snippets.

@dgaitan
Created July 10, 2022 19:40
Show Gist options
  • Save dgaitan/2a54d9d9b94a1c1276fd42535032b3eb to your computer and use it in GitHub Desktop.
Save dgaitan/2a54d9d9b94a1c1276fd42535032b3eb to your computer and use it in GitHub Desktop.
WordPress Hooks
<?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