bbp_register_theme_package( array $theme = array(),  $override = true )

Register a new bbPress theme package to the active theme packages array


Description Description


Parameters Parameters

$theme

(Optional)

Default value: array()


Top ↑

Source Source

File: includes/core/theme-compat.php

function bbp_register_theme_package( $theme = array(), $override = true ) {

	// Create new BBP_Theme_Compat object from the $theme array
	if ( is_array( $theme ) ) {
		$theme = new BBP_Theme_Compat( $theme );
	}

	// Bail if $theme isn't a proper object
	if ( ! is_a( $theme, 'BBP_Theme_Compat' ) ) {
		return;
	}

	// Load up bbPress
	$bbp = bbpress();

	// Only override if the flag is set and not previously registered
	if ( empty( $bbp->theme_compat->packages[ $theme->id ] ) || ( true === $override ) ) {
		$bbp->theme_compat->packages[ $theme->id ] = $theme;
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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