-
-
Save cyberwani/4396371 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| /** | |
| * My Plugin | |
| * | |
| * @uses add_filter() for 'the_content': make love not content | |
| * @uses add_filter() for 'get_the_excerpt': clearly announce all excerpts | |
| */ | |
| class my_plugin | |
| { | |
| function __construct() { | |
| // make love not content | |
| add_filter( 'the_content', function ( $content ) { | |
| return $content . " ♥"; | |
| }); | |
| // clearly announce all excerpts | |
| add_filter( 'get_the_excerpt', function ( $excerpt ) { | |
| return '<strong>' . __( 'EXCERPT' ) . ':</strong> ' . $excerpt; | |
| }); | |
| } | |
| } |
This file contains hidden or 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 | |
| add_filter( 'tag', 'myfunname' /* ... */ ); | |
| add_filter( 'tag', array( $this, 'myfunname' ) /* ... */ ); | |
| add_filter( 'tag', array( __CLASS__, 'myfunname' ) /* ... */ ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment