bp_nouveau_group_reset_front_template( array $templates = array(), BP_Groups_Group $group = null )

Add the default group front template to the front template hierarchy.


Description Description


Parameters Parameters

$templates

(Optional) The list of templates for the front.php template part.

Default value: array()

$group

(Optional) The group object.

Default value: null


Top ↑

Return Return

(array) The same list with the default front template if needed.


Top ↑

Source Source

File: bp-templates/bp-nouveau/includes/groups/functions.php

function bp_nouveau_group_reset_front_template( $templates = array(), $group = null ) {
	if ( empty( $group->id ) ) {
		return $templates;
	}

	$use_default_front = bp_nouveau_get_appearance_settings( 'group_front_page' );

	// Setting the front template happens too early, so we need this!
	if ( is_customize_preview() ) {
		$use_default_front = bp_nouveau_get_temporary_setting( 'group_front_page', $use_default_front );
	}

	if ( ! empty( $use_default_front ) ) {
		array_push( $templates, 'groups/single/default-front.php' );
	}

	/**
	 * Filters the BuddyPress Nouveau template hierarchy after resetting front template for groups.
	 *
	 * @since 3.0.0
	 *
	 * @param array $templates Array of templates.
	 */
	return apply_filters( '_bp_nouveau_group_reset_front_template', $templates );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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