BP_Registration_Theme_Compat::template_hierarchy( string $templates )

Add template hierarchy to theme compat for registration/activation pages.

Description

This is to mirror how WordPress has template hierarchy.

Parameters

$templates

(string) (Required) The templates from bp_get_theme_compat_templates().

Return

(array) $templates Array of custom templates to look for.

Source

File: bp-members/classes/class-bp-registration-theme-compat.php

	public function template_hierarchy( $templates ) {
		$component = sanitize_file_name( bp_current_component() );

		/**
		 * Filters the template hierarchy for theme compat and registration/activation pages.
		 *
		 * This filter is a variable filter that depends on the current component
		 * being used.
		 *
		 * @since BuddyPress 1.8.0
		 *
		 * @param array $value Array of template paths to add to hierarchy.
		 */
		$new_templates = apply_filters( "bp_template_hierarchy_{$component}", array(
			"members/index-{$component}.php"
		) );

		// Merge new templates with existing stack
		// @see bp_get_theme_compat_templates().
		$templates = array_merge( (array) $new_templates, $templates );

		return $templates;
	}

Changelog

Changelog
Version Description
BuddyPress 1.8.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.