bp_register_theme_package( array $theme = array(), bool $override = true )
Register a new BuddyPress theme package in the active theme packages array.
Description
For an example of how this function is used, see: BuddyPress::register_theme_packages().
See also
- BP_Theme_Compat: for a description of the $theme parameter arguments.
Parameters
- $theme
-
(Optional) See BP_Theme_Compat.
Default value: array()
- $override
-
(Optional) If true, overrides whatever package is currently set. Default: true.
Default value: true
Source
File: bp-core/bp-core-theme-compatibility.php
function bp_register_theme_package( $theme = array(), $override = true ) { // Create new BP_Theme_Compat object from the $theme array. if ( is_array( $theme ) ) { $theme = new BP_Theme_Compat( $theme ); } // Bail if $theme isn't a proper object. if ( ! is_a( $theme, 'BP_Theme_Compat' ) ) { return; } // Load up BuddyPress. $bp = buddypress(); // Only set if the theme package was not previously registered or if the // override flag is set. if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) { $bp->theme_compat->packages[$theme->id] = $theme; } }
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.