• Does the theme change how the default “apply_filters” action is handled by WordPress, specifically for something like:

    apply_filters('the_content', 'string-to-filter');

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author presscustomizr

    (@nikeo)

    Hi, there’s one filter applied to this tag in the theme :

    function tc_fancybox_content_filter( $content) {
            $tc_fancybox = esc_attr( tc__f( '__get_option' , 'tc_fancybox' ) );
    
            if ( 1 == $tc_fancybox )
            {
                global $post;
                if ( !isset($post) )
                  return;
                $pattern ="/<a(.*?)href=( '|\")(.*?).(bmp|gif|jpeg|jpg|png)( '|\")(.*?)>/i";
                $replacement = '<a$1href=$2$3.$4$5 class="grouped_elements" rel="tc-fancybox-group'.$post -> ID.'"$6>';
                $content = preg_replace( $pattern, $replacement, $content);
            }
    
            return apply_filters( 'tc_fancybox_content_filter', $content );
          }

    Hi Nikeo,

    is there a possibility to remove/disable the filter?

    One of my plugins also uses ‘the_content’ tag too.
    I get into trouble there.

    I have tried remove_filter in my functions.php child-theme but it doesn’t work. I think because the functions.php is read before the theme?

    Sorry, I’m a newbie ??

    Theme Author presscustomizr

    (@nikeo)

    Hi @toschuh, you can manually uncheck this option in appearance > customizer > images > Enable/disable lightbox effect on images. => This will disable the filter.
    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘apply_filters – the_content’ is closed to new replies.