Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/27/2010 10:05:52 PM (16 years ago)
Author:
djpaul
Message:

First pass of menu support for BP-Default. See #2691.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/functions.php

    r3312 r3325  
    11<?php
    2 
    32// Stop the theme from killing WordPress if BuddyPress is not enabled.
    43if ( !class_exists( 'BP_Core_User' ) )
     
    1514        )
    1615);
     16
     17// Register navigation menu
     18register_nav_menus( array(
     19        'primary' => __( 'Primary Navigation', 'buddypress' ),
     20) );
    1721
    1822// Load the AJAX functions for the theme
     
    336340        add_action( 'admin_notices', 'bp_dtheme_show_notice' );
    337341
     342/**
     343 * wp_nav_menu() callback from the main navigation in header.php
     344 *
     345 * Used when the custom menus haven't been configured.
     346 *
     347 * @param array Menu arguments from wp_nav_menu()
     348 * @package BuddyPress Theme
     349 * @see wp_nav_menu()
     350 * @since 1.3
     351 */
     352function bp_dtheme_main_nav( $args ) {
     353?>
     354        <ul id="nav">
     355                <li<?php if ( bp_is_front_page() ) : ?> class="selected"<?php endif; ?>>
     356                        <a href="<?php echo site_url() ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a>
     357                </li>
     358
     359                <?php wp_list_pages( 'title_li=&depth=1&exclude=' . bp_dtheme_page_on_front() ); ?>
     360                <?php do_action( 'bp_nav_items' ); ?>
     361        </ul><!-- #nav -->
     362<?php
     363}
    338364
    339365// Member Buttons
     
    357383if ( bp_is_active( 'blogs' ) )
    358384        add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
    359 
    360385?>
Note: See TracChangeset for help on using the changeset viewer.