Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function toggle_shortcode( $atts, $content = null )
- {
- extract( shortcode_atts(
- array(
- 'title' => 'Click To Open',
- 'state' => '',
- ),
- $atts ) );
- $state = ( $state == 'open' ) ? 'open-toggle' : null;
- $active = ( $state == 'open-toggle' ) ? 'active' : null;
- return '<div class="toggle-wrap '. $state .'"><h3 class="trigger '. $active .'"><a href="#" title="'. __('Toggle', 'wpex') .'">'. $title .'</a></h3><div class="toggle_container">' . do_shortcode($content) . '</div></div>';
- }
- add_shortcode('toggle', 'toggle_shortcode');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement