WordPress.org

Ready to get started?Download WordPress

Forums

locate_template ignores add_filter in loaded template (1 post)

  1. baranka
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic