Skip to content

Instantly share code, notes, and snippets.

@tomjn
Last active December 21, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomjn/2cff1362adcdffff6907 to your computer and use it in GitHub Desktop.
Save tomjn/2cff1362adcdffff6907 to your computer and use it in GitHub Desktop.
<?php
class ContentAppender {
private $message ='';
public function __construct( $message ) {
$this->message = $message;
add_filter( 'the_content', array( $this, 'add_content' );
}
public function add_content( $content) {
return $content.$this->message;
}
}
// print a message in the footer
$contentappender = new ContentAppender( 'This appears at the end of the content' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment