-
-
Save tomjn/2cff1362adcdffff6907 to your computer and use it in GitHub Desktop.
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 | |
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