Support » Plugins » locate_template ignores add_filter in loaded template

  • Hi,

    I have a file.php I want to include in functions.php. Inside file.php I have filter – add_filter( ‘script_loader_src’, ‘filter_script_loader’, 1 )

    When I use require( get_template_directory() . ‘/inc/file.php’ ) the add_filter works as expected.

    When I use locate_template(‘inc/file.php’, true) the add_filter seems to be ignored, why?

    Any help would be appreciated.

  • The topic ‘locate_template ignores add_filter in loaded template’ is closed to new replies.