Skip to:
Content

BuddyPress.org

Ticket #3422: 3422.01.patch

File 3422.01.patch, 1.3 KB (added by boonebgorges, 9 years ago)
  • bp-core/bp-core-functions.php

    function bp_core_get_page_meta() { 
    9292                }
    9393        }
    9494
     95        foreach( $page_ids as $component_name => $page_id ) {
     96                if ( empty( $component_name ) || empty( $page_id ) )
     97                        unset( $page_ids[$component_name] );
     98        }
     99
    95100        return apply_filters( 'bp_core_get_page_meta', $page_ids );
    96101}
    97102
    function bp_core_update_page_meta( $blog_page_ids ) { 
    121126function bp_core_get_page_names() {
    122127        global $wpdb, $bp;
    123128
    124         // Set pages as standard class
    125         $pages = new stdClass;
    126 
    127129        // Get pages and IDs
    128130        if ( $page_ids = bp_core_get_page_meta() ) {
     131               
     132                // Set pages as standard class
     133                $pages = new stdClass;
    129134
    130135                $posts_table_name = bp_is_multiblog_mode() ? $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts' : $wpdb->posts;
    131136                $page_ids_sql     = implode( ',', (array)$page_ids );
    function bp_core_add_root_component( $slug ) { 
    10681073
    10691074        if ( empty( $bp->pages ) )
    10701075                $bp->pages = bp_core_get_page_names();
    1071 
     1076               
    10721077        $match = false;
    1073 
     1078       
    10741079        // Check if the slug is registered in the $bp->pages global
    10751080        foreach ( (array)$bp->pages as $key => $page ) {
    10761081                if ( $key == $slug || $page->slug == $slug )