Skip to:
Content

BuddyPress.org

Changeset 6447


Ignore:
Timestamp:
10/22/2012 07:54:13 AM (8 years ago)
Author:
johnjamesjacoby
Message:

bp_core_exclude_pages():

  • Bail early if not the root blog.
  • Use buddypress() function in place of $bp global.
  • Remove additional forum logic; will be moved into bp-forums component and/or bbPress at future date.
File:
1 edited

Legend:

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

    r6439 r6447  
    7777 * @return array The list of page ID's to exclude
    7878 */
    79 function bp_core_exclude_pages( $pages ) {
    80     global $bp;
    81 
    82     if ( bp_is_root_blog() ) {
    83         if ( !empty( $bp->pages->activate ) )
    84             $pages[] = $bp->pages->activate->id;
    85 
    86         if ( !empty( $bp->pages->register ) )
    87             $pages[] = $bp->pages->register->id;
    88 
    89         if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
    90             $pages[] = $bp->pages->forums->id;
    91     }
     79function bp_core_exclude_pages( $pages = array() ) {
     80
     81    // Bail if not the root blog
     82    if ( ! bp_is_root_blog() )
     83        return $pages;
     84
     85    $bp = buddypress();
     86
     87    if ( !empty( $bp->pages->activate ) )
     88        $pages[] = $bp->pages->activate->id;
     89
     90    if ( !empty( $bp->pages->register ) )
     91        $pages[] = $bp->pages->register->id;
     92
     93    if ( !empty( $bp->pages->forums ) )
     94        $pages[] = $bp->pages->forums->id;
    9295
    9396    return apply_filters( 'bp_core_exclude_pages', $pages );
Note: See TracChangeset for help on using the changeset viewer.