Anonymous Objects class Davina_Plugin { function __construct() { add_filter( 'the_content', array( $this, 'swear' ), -1 ); } function swear( $content ) { return "Hello big brother house, you are live on channel 4, do not say sh*t f*ck or b*gger"; } } new Davina_Plugin();