How to replace shortcode with its result into the database?
-
I want to replace shortcodes with their respective output to the database. I was told this code does that, but I am new to wordpress development, I don’t know where to paste this function, and how to call it.
function so_modify_the_content( $content ) { $prependContent = do_shortcode( 'pre_content_shortcode' ); $appendContent = do_shortcode( 'post_content_shortcode' ); $content = $prependContent . $content . $appendContent; return $content; } add_filter( 'the_content', 'so_modify_the_content' );
At least point me to articles mentioning how to use functions.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘How to replace shortcode with its result into the database?’ is closed to new replies.