The only thing that you can filter is the attributes fo the shortcode:
apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts );
Point is, that $shortcode
is the third argument when registering a shortcode. This argument is pretty new and nearly no shortcode uses it, therefore it will fall back to the default - which is a string
of ''
.
This leads to a funny result:
add_filter( 'shortcode_atts_', 'wpse112294_shortcode_atts_cb' );
function wpse112294_shortcode_atts_cb( $out, $pairs, $atts )
{
// here we need to find a way to uniquely identify a shortcode
// for which we ain't got a name
// something that makes the shortcode unique:
$found = isset( $pairs['foo_attribute_key'] );
if ( $found )
{
// Instantly remove this filter to save processing time:
remove_filter( current_filter(), __FUNCTION__ );
// do something stunning in here!
}
return $out;
}
So, yes, with a 90% chance we need to filter the output of every(!) shortcode and try to somehow identify the shortcode by either some default arguments ($pairs
) or by input arguments (impossible). Then, finally we're able to process the output. Are we able to process the string itself? No. This has to be done the way @s_ha_dum showed above.