5
<?php echo do_shortcode('[mingleforum]'); ?>

inserts the mingle forum into my content!

is it possible to use add_filter() on that?

2
  • To filter what? What are you trying to achieve?
    – Bainternet
    Commented Apr 3, 2011 at 14:05
  • This plugin uses a lot of weird and bad inline styles like <div style="padding:10px" etc. I want to get rid of that on the serverside. I just wonder if that's possible! Commented Apr 3, 2011 at 14:47

2 Answers 2

2

You can change your code to this:

<?php
$shortcode = do_shortcode('[mingleforum]');
echo apply_filters('my_new_filter',$shortcode);
?>

and then you can interact with that filter

add_filter('my_new_filter','my_new_filter_callback');

function my_new_filter_callback($shortcode){
    //to stuff here
    return $shortcode;
}
6

As of 4.7 two filters pre_do_shortcode_tag and do_shortcode_tag have been added which you can use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.