philbuchanan / Accordion-Shortcodes

A WordPress plugin that adds a few shortcodes to allow for accordion dropdowns.
https://wordpress.org/plugins/accordion-shortcodes/
16 stars 10 forks source link

Filtering Shortcodes not working #81

Open CorneliusIV opened 4 years ago

CorneliusIV commented 4 years ago

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?

philbuchanan commented 4 years ago

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.

CorneliusIV commented 4 years ago

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