Support » Plugin: Shortcoder ā€” Create Shortcodes for Anything » Custom Shortcode parameters

  • Resolved blogvii

    (@blogvii)


    Hi, I can see some default “Shortcode parameters” : $$post_modified_date$$, $$year$$,..

    I added some custom shortcode parameters, ex:$$total_post$$, $$total_comment$$ by modifying plugin.

    Is there a way to add custom shortcode parameters but not modify the plugin?

    Best Regrads,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @blogvii,

    Thanks for using Shortcoder.
    Yes there are hooks available using which you can add wordpress parameters to the list.

    Please see gist below for an example on how Woocommerce related parameters were added to the list.

    https://gist.github.com/vaakash/f4891252f698a62bb0dc21d040853e7e

    So basically you need to hook into two filters.

            add_filter( 'sc_mod_wp_params', '<function to add to the list>' );
            add_filter( 'sc_mod_metadata', '<function to execute the params>' );

    Thanks,
    Aakash

    Thread Starter blogvii

    (@blogvii)

    Hi @vaakash ,

    It’s working perfectly. This save me a lot of time for not modifying plugin every update. I hope you provide more hook and filter in the future. This will make Shortcoder more powerful !

    Best Regrads,

    Plugin Author vaakash

    (@vaakash)

    Hi @blogvii,

    Cheers ! Yes, these hooks were available earlier but I missed to document them. I’ll add these to the doc and introduce new ones where ever possible.

    Thanks,
    Aakash

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.