shortcode not working
-
I have a plugin I’ve created and am using a shortcode. for some reason, I cannot get the shortcode to work.
if(!class_exists('FE_SuperFiction')) { class FE_SuperFiction { function __construct() { /** bunch of other code here **/ add_shortcode('fanficme_fanfiction', array(&$this, 'FeFiction_Site_Display')); } /** bunch of other code here **/ } function FeFiction_Site_Display() { /** bunch of code here **/ echo __LINE__.' - test '; /** bunch of code here **/ } } }I then add a page with the content being: [fanficme_fanfiction]
I then visit that page and it still shows [fanficme_fanfiction] instead of the output I expect (in the above case, the line number and the text ” – test”.
I even went into wp-includes/shortcodes.php and confirmed that my shortcode is included.
From the output of printing $output contained in do_shortcode:
(.?)\[(embed)\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?) (.?)\[(wp_caption|caption|gallery|embed|fanficme_fanfiction|ratings)\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘shortcode not working’ is closed to new replies.