id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 13239,Filter locate_template template_names variable,chrisjean,,"I recently encountered a situation where it would be very helpful to supply alternate template file locations; however, this cannot be accomplished as the locate_template function is being used and that function's arguments are not filterable. So, I created a patch that adds the filter. This patch adds two filters: locate_template and locate_template-TEMPLATENAME. This allows for both general and specific filtering. The following example shows how this could be used to modify the location of a BuddyPress template file. {{{ function filter_member_header_template( $template ) { return dirname( __FILE__ ) . '/buddypress/members/single/member-header.php'; } add_filter( 'locate_template-members/single/member-header.php', 'filter_member_header_template' ); }}} While the value of this example is debatable as BuddyPress could be updated to support alternate template locations, the value of the patch itself is high. This opens up a new ability for plugins to modify template file locations, giving plugins a hook into the content rendering process without requiring themes to be modified.",enhancement,reopened,normal,Future Release,Themes,3.0,normal,,has-patch dev-feedback,,