Last active
March 17, 2022 11:25
-
-
Save ahmedeshaan/d30e5c826a6473837dc5e00faebcbbe4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function overwrite_shortcode() { | |
function overridden_ux_accordion_item( $atts, $content = null ) { | |
extract(shortcode_atts(array( | |
'title' => 'Accordion Panel', | |
'class' => '', | |
), $atts)); | |
$classes = array( 'accordion-item' ); | |
if ( $class ) $classes[] = $class; | |
return '<div class="' . implode( ' ', $classes ) . '"><a href="#" class="accordion-title plain"><button class="toggle"><i class="icon-angle-down"></i></button><h2>' . $title . '<h2></a><div class="accordion-inner">' . do_shortcode( $content ) . '</div></div>'; | |
} | |
remove_shortcode('accordion-item'); | |
add_shortcode('accordion-item', 'overridden_ux_accordion_item'); | |
} | |
add_action('wp_loaded', 'overwrite_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment