• Resolved blogvii

    (@blogvii)


    Hi @vaakash,

    I saw a new filter sc_mod_content that you added recently. Could you please guide me on how to use it and what it can do?

    Thanks.

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

    (@vaakash)

    Hi @blogvii,

    Yes there is a new filter introduced in the latest version.

    If you work with PHP and if you are aware of WordPress hooks then you can make use of this feature to alter the shortcode content programmatically as you need.

    I’ll try to add documentation for this soon.

    Below is a simple example, where shortcode content will be wrapped with <div> tag when the shortcodes are executed. You can manipulate the shortcode content and do numerous stuff with this filter.

    function sc_change_cnt( $cnt, $atts, $settings ){
        $cnt = '<div>' . $cnt . '</div>' ;
        return $cnt;
    }
    
    add_filter( 'sc_mod_content', 'sc_change_cnt', 10, 3 );

    Some ideas include, you can replace some placeholder in the shortcode content with some text, do some formatting programmatically etc.

    Thanks,
    Aakash

    Thread Starter blogvii

    (@blogvii)

    Hello, @vaakash

    Thanks for the great update and reply.

    This is perfect for modifying the shortode content before executing. I’m thinking about adding some class and condition to the shortcode content before it displays.

    Thanks and I hope you have a good day.

    John.

    Plugin Author vaakash

    (@vaakash)

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘About Filter sc_mod_content’ is closed to new replies.