Changeset 7266 for trunk/bp-core/bp-core-theme-compatibility.php
- Timestamp:
- 07/10/2013 07:57:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-theme-compatibility.php
r7228 r7266 316 316 * Register a new BuddyPress theme package to the active theme packages array 317 317 * 318 * @since BuddyPress (1.7) 319 * @param array $theme 318 * The $theme parameter is an array, which takes the following values: 319 * 320 * 'id' - ID for your theme package; should be alphanumeric only 321 * 'name' - Name of your theme package 322 * 'version' - Version of your theme package 323 * 'dir' - Directory where your theme package resides 324 * 'url' - URL where your theme package resides 325 * 326 * For an example of how this function is used, see: 327 * {@link BuddyPress::register_theme_packages()}. 328 * 329 * @since BuddyPress (1.7) 330 * 331 * @param array $theme The theme package arguments. See phpDoc for more details. 332 * @param bool $override If true, overrides whatever package is currently set. 320 333 */ 321 334 function bp_register_theme_package( $theme = array(), $override = true ) { 322 335 323 336 // Create new BP_Theme_Compat object from the $theme array 324 if ( is_array( $theme ) ) 337 if ( is_array( $theme ) ) { 325 338 $theme = new BP_Theme_Compat( $theme ); 339 } 326 340 327 341 // Bail if $theme isn't a proper object 328 if ( ! is_a( $theme, 'BP_Theme_Compat' ) ) 342 if ( ! is_a( $theme, 'BP_Theme_Compat' ) ) { 329 343 return; 344 } 330 345 331 346 // Load up BuddyPress 332 347 $bp = buddypress(); 333 348 334 // Only override if the flag is set and not previously registered 349 // Only set if the theme package was not previously registered or if the 350 // override flag is set 335 351 if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) { 336 352 $bp->theme_compat->packages[$theme->id] = $theme;
Note: See TracChangeset
for help on using the changeset viewer.