Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/03/2011 09:03:41 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Add bp-pages admin interface for all components. Rename bp-pages related functions to match existing nomenclature. Introduce 'has_directory' variable in BP_Component class to assist in pairing page slugs to component directories. Set 'path' variable in components that were missing them. Clean up white space where tabs were used instead of spaces. See #3428. Props boonebgorges.

File:
1 edited

Legend:

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

    r4907 r4920  
    3838
    3939    // Don't catch URIs on non-root blogs unless multiblog mode is on
    40     if ( !bp_is_root_blog() && !bp_is_multiblog_mode() ) {
     40    if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
    4141        return false;
    42     }
    4342
    4443    // Fetch all the WP page names for each component
    4544    if ( empty( $bp->pages ) )
    46         $bp->pages = bp_core_get_page_names();
     45        $bp->pages = bp_core_get_directory_pages();
    4746
    4847    // Ajax or not?
     
    7877                $bkey = array_search( $chunk, $bp_uri );
    7978
    80                 if ( $bkey !== false )
     79                if ( $bkey !== false ) {
    8180                    unset( $bp_uri[$bkey] );
     81                }
    8282
    8383                $bp_uri = array_values( $bp_uri );
     
    115115    if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) ) {
    116116        $post = get_post( get_option( 'page_on_front' ) );
    117         if ( !empty( $post ) )
     117        if ( !empty( $post ) ) {
    118118            $bp_uri[0] = $post->post_name;
     119        }
    119120    }
    120121
     
    311312    $object_id = 0;
    312313    foreach ( (array)$bp->pages as $page ) {
    313         if ( isset( $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) && $page->name == $bp_unfiltered_uri[$bp_unfiltered_uri_offset] )
     314        if ( isset( $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) && $page->name == $bp_unfiltered_uri[$bp_unfiltered_uri_offset] ) {
    314315            $object_id = $page->id;
     316        }
    315317    }
    316318
     
    397399
    398400    $defaults = array(
    399         'mode'      => '1',         // 1 = $root, 2 = wp-login.php
    400         'message'   => __( 'You must log in to access the page you requested.', 'buddypress' ),
    401         'redirect'  => wp_guess_url(),  // the URL you get redirected to when a user successfully logs in
    402         'root'      => $bp->root_domain // the landing page you get redirected to when a user doesn't have access
     401        'mode'     => '1',              // 1 = $root, 2 = wp-login.php
     402        'message'  => __( 'You must log in to access the page you requested.', 'buddypress' ),
     403        'redirect' => wp_guess_url(),   // the URL you get redirected to when a user successfully logs in
     404        'root'     => $bp->root_domain  // the landing page you get redirected to when a user doesn't have access
    403405    );
    404406
     
    421423                bp_core_redirect( $root );
    422424            }
    423         break;
     425
     426            break;
    424427
    425428        // Redirect to root with "redirect_to" parameter
     
    438441
    439442            bp_core_redirect( $url );
    440         break;
     443
     444            break;
    441445    }
    442446}
Note: See TracChangeset for help on using the changeset viewer.