You appear to be a bot. Output may be restricted
Description
Implement the [bw_tabs] shortcode to display posts or pages styled for jQuery tabsBasically we achieve what we can do manually using [bw_jq], [divs], lists and more divs for the each post's body [bw_jq selector="#tabs" method=tabs script=jquery-ui-tabs] [div id=tabs] <ul> <li><a href="#tab1">First</a></li> <li><a href="#tab2">Second</a></li> <li><a href="#tab3">Third</a></li> </ul> <div id="tab1">I am the first part of the tabs</div> <div id="tab2">I am the second part of the tabs</div> <div id="tab3">I am the third part of the tabs</div> [ediv]
Usage
bw_tabs( $atts, $content, $tag );
Parameters
- $atts
- ( mixed ) optional –
- $content
- ( mixed ) optional –
- $tag
- ( mixed ) optional –
Returns
voidSource
File name: oik/shortcodes/oik-tabs.phpLines:
1 to 28 of 28
function bw_tabs( $atts=null, $content=null, $tag=null ) { oik_require( "includes/bw_posts.php" ); $posts = bw_get_posts( $atts ); if ( $posts ) { oik_require( "shortcodes/oik-jquery.php" ); $debug = bw_array_get( $atts, "debug", false ); bw_jquery_enqueue_script( "jquery-ui-tabs", $debug ); bw_jquery_enqueue_style( "jquery-ui-tabs" ); $selector = bw_tabs_id(); bw_jquery( "#$selector", "tabs" ); $class = bw_array_get( $atts, "class", "bw_tabs" ); sdiv( $class, $selector ); $cp = bw_current_post_id(); sul(); foreach ( $posts as $post ) { bw_format_tabs_list( $post, $atts, $selector ); } eul(); foreach ( $posts as $post ) { bw_current_post_id( $post->ID ); bw_format_tabs( $post, $atts, $selector ); } ediv( $class ); bw_current_post_id( $cp ); bw_clear_processed_posts(); } return( bw_ret() ); }View on GitHub View on Trac