Use content custom filter for all shortcodes

so I would like to execute a filter or something that works on every shortcode

Looks like you’re after do_shortcode_tag. It “Filters the output created by a shortcode callback.”.

Aurovrata Venet gives a demo usage similar to:

add_filter( 'do_shortcode_tag',function ($output, $tag, $attr){

  //make sure it is the right shortcode
  if('aShortcode' != $tag){ 
    return $output;
  }

  //you can even check for specific attributes
  if(!isset($attr['id'])){ 
    return $output;
  }

  $output .= '.. do somthing ..';

  return $output;
},10,3);

Leave a Comment