Skip to content

Instantly share code, notes, and snippets.

@tomjn tomjn/gist:2cff1362adcdffff6907 Secret
Last active Dec 21, 2015

Embed
What would you like to do?
<?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
You can’t perform that action at this time.