WordPress filter hook

bp_located_template

Fired by 5 WordPress plugins, running on 90K+ sites between them.

“Filters the template locations.”

How to use bp_located_template

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'bp_located_template', function( $locate_template, $template ) {
	// Change $locate_template here.
	return $locate_template;
}, 10, 2 );

Argument names come from BuddyPress Wall's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire bp_located_template

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. BuddyPress icon BuddyPress90,000+ installs apply_filters( 'bp_located_template', $template, $filtered_templates ) bp-core/bp-core-catchuri.php:137
  2. BuddyPress Wall icon BuddyPress Wall40+ installs apply_filters( 'bp_located_template', locate_template( $template , false ), $template ) includes/bp-wall-screens.php:101
  3. BuddyPress FollowMe icon BuddyPress FollowMe10+ installs apply_filters( 'bp_located_template', locate_template( $template , false ), $template ) includes/bp-follow-functions.php:525
  4. BuddyPress Portfolio icon BuddyPress Portfolio10+ installs apply_filters( 'bp_located_template', locate_template( $template , false ), $template ) includes/bp-portfolio-functions.php:31
  5. v voting icon v voting10+ installs apply_filters( 'bp_located_template', locate_template( $template , false ), $template ) includes/bp-voting-functions.php:31

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.