Accordion-Shortcodes icon indicating copy to clipboard operation
Accordion-Shortcodes copied to clipboard

Filtering Shortcodes not working

Open CorneliusIV opened this issue 5 years ago • 2 comments

I tried to use this example from the Readme but it does not seem to work.

    add_filter('shortcode_atts_accordion', 'set_accordion_shortcode_defaults', 10, 3);
    function set_accordion_shortcode_defaults($atts) {
        // Override the openfirst setting here
        $atts['openfirst'] = true;
        return $atts;
    }

Is shortcode_atts_accordion hook correct, I do not see any reference to it in the code?

CorneliusIV avatar Oct 22 '19 19:10 CorneliusIV

That snippet uses the shortcode_atts_(shortcode) filter built into Wordpress.

Admittedly I haven't tested this in several years so I have no idea if it still works.

philbuchanan avatar Oct 22 '19 20:10 philbuchanan

@philbuchanan thanks I didn't even realize that. Let me look into that some more.

CorneliusIV avatar Oct 23 '19 15:10 CorneliusIV