bp_template_include_theme_supports( string $template = '' )

Possibly intercept the template being loaded.

Description

Listens to the ‘template_include’ filter and waits for any BuddyPress specific template condition to be met. If one is met and the template file exists, it will be used; otherwise.

Note that the _edit() checks are ahead of their counterparts, to prevent them from being stomped on accident.

Parameters

$template

(Optional) The path to the template file that is being used.

Default value: ''

Return

(string) The path to the template file that is being used.

Source

File: bp-core/bp-core-template-loader.php

function bp_template_include_theme_supports( $template = '' ) {

	/**
	 * Filters whether or not to override the template being loaded in parent/child themes.
	 *
	 * @since BuddyPress 1.7.0
	 *
	 * @param bool   $value    Whether or not there is a file override. Default false.
	 * @param string $template The path to the template file that is being used.
	 */
	$new_template = apply_filters( 'bp_get_root_template', false, $template );

	// A BuddyPress template file was located, so override the WordPress
	// template and use it to switch off BuddyPress's theme compatibility.
	if ( ! empty( $new_template ) ) {
		$template = bp_set_template_included( $new_template );
	}

	/**
	 * Filters the final template being loaded in parent/child themes.
	 *
	 * @since BuddyPress 1.7.0
	 *
	 * @param string $template The path to the template file that is being used.
	 */
	return apply_filters( 'bp_template_include_theme_supports', $template );
}

Changelog

Changelog
Version Description
BuddyPress 1.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.