Skip to content

Instantly share code, notes, and snippets.

@TravisBallard
Last active December 10, 2015 15:59
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 TravisBallard/4458315 to your computer and use it in GitHub Desktop.
Save TravisBallard/4458315 to your computer and use it in GitHub Desktop.
filter shortcode example - does not work
<?php
/**
* plugin name: test shortcode filter
* author: travis ballard
*/
class ShortcodeFilter
{
public $shortcode = 'testshortcode';
public function __construct(){
add_shortcode( apply_filters( 'test_shortcode_filter', $this->shortcode ), array( $this, 'shortcode' ) );
}
public function shortcode($a){
return '<p>The shortcode worked!</p>';
}
}
$sf = new ShortcodeFilter();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment