Site icon Hip-Hop Website Design and Development

Execute Closing Shortcode After the_content

I have to execute a brief code on hundreds of posts which do not already comprise the quick code as i’ve added some manually.

I am utilizing one other perform so as to add the opening quick code after the 2nd paragraph which works.

I’ve written this code which outputs the closing quick code after the content material but it surely does’t execute.

add_filter( 'the_content', 'closing_shortcode' );
perform closing_shortcode( $content material ) {

        if( !has_shortcode( $content material, 'members') )
        return $content material;

        $close_shortcode = do_shortcode('[/member]');

        return $content material . $close_shortcode;
}       

Possibly i would like to make use of echo do_shortcode.