Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2013 02:01:12 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Theme Compatibility:

  • Intro duce bp_is_current_component_core() function, to determine if the current component is an active core component.
  • Use above function in plugins.php, to help determine whether or not to display the options navigation.
  • Update the root level single-member templates to use switch statements, per the settings components convention.
  • Fixes #4772.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r6697 r6783  
    11421142}
    11431143
     1144/**
     1145 * Is the current component an active core component.
     1146 *
     1147 * Use this function when you need to check if the current component is an
     1148 * active core component of BuddyPress. If the current component is inactive, it
     1149 * will return false. If the current component is not part of BuddyPress core,
     1150 * it will return false. If the current component is active, and is part of
     1151 * BuddyPress core, it will return true.
     1152 *
     1153 * @since BuddyPress (1.7)
     1154 * @return boolean
     1155 */
     1156function bp_is_current_component_core() {
     1157    $retval            = false;
     1158    $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
     1159
     1160    foreach ( array_keys( $active_components ) as $active_component ) {
     1161        if ( bp_is_current_component( $active_component ) ) {
     1162            $retval = true;
     1163            break;
     1164        }
     1165    }
     1166
     1167    return $retval;
     1168}
     1169
    11441170/** Activity ******************************************************************/
    11451171
Note: See TracChangeset for help on using the changeset viewer.