I have this plugin installed on my WordPress:
http://wordpress.org/plugins/put/
Iâm trying to make a plugin that uses the UI Tabs plugin inside my own plugin.
My plugin code so far:
function load_jquery(){
echo '<link rel='stylesheet' id='jquery-ui-tabs-css' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/smoothness/jquery-ui.css?ver=1.9.2' type='text/css' media='all' />';
}
add_action('wp_head','load_jquery');
function print_tabs(){
echo do_shortcode('[tab name="Tab"]-[/tab]');
echo do_shortcode('[end_tabset]');
}
add_shortcode('print_tabs', 'print_tabs');
Now if I use the [print_tabs]
shortcode in a new page, it should look like this:
http://img835.imageshack.us/img835/4905/workingp.png
But itâs not working, and it looks like this:
http://imageshack.us/a/img62/9772/notworkingm.png
What could be the problem here?
The problem, from what I can see in put.php in the Post UI Tabs plugin is that the shortcodes are only added during the “the_content” filter in a function called “on_the_content”.
(line 96 of put.php)
And that function looks like:
(starting at line 118 of put.php)
So, given how this plugin is written by modifying the content with a filter which in turn adds the shortcodes when that filter is run, what you’re seeing is probably happening because when you call “do_shortcode” those shortcodes don’t actually exist.
What echoing do_shortcode is doing then, is just coughing up the text.
Unfortunately, because of the way the Post UI Tabs plugin is written, you may not be able to do what you’re trying to do.