bp_template_include_theme_supports( string $template = '' )

Possibly intercept the template being loaded.


Description 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 Parameters

$template

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

Default value: ''


Top ↑

Return Return

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


Top ↑

Source 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 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 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 );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.