I want to add a filter ... but not if it that filter is called by a specific function. Here's a simplified example:
<?php
add_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
function wp_trim_excerpt( $text ) {
$text = apply_filters( 'the_content', $text );
return $text;
}
add_filter( 'the_content', 'my_content_filter' );
function my_content_filter( $content ) {
// my code that modifies $content
return $content;
}
Is there any way to check if my_content_filter
is being initiated by wp_trim_excerpt
before running my code?
EDIT: The core function wp_trim_excerpt
is in play here, so I'd rather not alter the function if possible. Above I simplified it to the most pertinent part.