Skip to:
Content

BuddyPress.org

Changeset 5736


Ignore:
Timestamp:
02/12/2012 07:58:09 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Move bp_head() and bp_footer() actions into bp-core-hooks.php, and piggy back them onto wp_head() and wp_footer(). Also add some missing semi-colons in header.php and footer.php.

Location:
trunk
Files:
4 edited

Legend:

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

    r5524 r5736  
    6868add_action( 'bp_ready', 'bp_screens', 4 );
    6969
     70/** Theme *********************************************************************/
     71
     72// Piggy back WordPress theme actions
     73add_action( 'wp_head',   'bp_head'   );
     74add_action( 'wp_footer', 'bp_footer' );
     75
    7076/** Admin Bar *****************************************************************/
    7177
    7278// Setup the navigation menu
    73 add_action( 'admin_bar_menu', 'bp_setup_admin_bar',      11 );
     79add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 11 );
    7480
    7581/** The hooks *****************************************************************/
     
    217223}
    218224
     225/** Theme *********************************************************************/
     226
     227/**
     228 * Piggy-back action for BuddyPress specific <head> actions in a theme
     229 *
     230 * @since BuddyPress (1.6)
     231 *
     232 * @uses do_action() Calls 'bp_head' hook
     233 */
     234function bp_head() {
     235    do_action( 'bp_head' );
     236}
     237
     238/**
     239 * Piggy-back action for BuddyPress specific footer actions in a theme
     240 *
     241 * @since BuddyPress (1.6)
     242 *
     243 * @uses do_action() Calls 'bp_footer' hook
     244 */
     245function bp_footer() {
     246    do_action( 'bp_footer' );
     247}
     248
    219249?>
  • trunk/bp-themes/bp-default/footer.php

    r3771 r5736  
    11        </div> <!-- #container -->
    22
    3         <?php do_action( 'bp_after_container' ) ?>
    4         <?php do_action( 'bp_before_footer' ) ?>
     3        <?php do_action( 'bp_after_container' ); ?>
     4        <?php do_action( 'bp_before_footer'   ); ?>
    55
    66        <div id="footer">
    77            <?php if ( is_active_sidebar( 'first-footer-widget-area' ) || is_active_sidebar( 'second-footer-widget-area' ) || is_active_sidebar( 'third-footer-widget-area' ) || is_active_sidebar( 'fourth-footer-widget-area' ) ) : ?>
    88                <div id="footer-widgets">
    9                     <?php get_sidebar( 'footer' ) ?>
     9                    <?php get_sidebar( 'footer' ); ?>
    1010                </div>
    1111            <?php endif; ?>
    1212
    1313            <div id="site-generator" role="contentinfo">
    14                 <?php do_action( 'bp_dtheme_credits' ) ?>
    15                 <p><?php printf( __( 'Proudly powered by <a href="%1$s">WordPress</a> and <a href="%2$s">BuddyPress</a>.', 'buddypress' ), 'http://wordpress.org', 'http://buddypress.org' ) ?></p>
     14                <?php do_action( 'bp_dtheme_credits' ); ?>
     15                <p><?php printf( __( 'Proudly powered by <a href="%1$s">WordPress</a> and <a href="%2$s">BuddyPress</a>.', 'buddypress' ), 'http://wordpress.org', 'http://buddypress.org' ); ?></p>
    1616            </div>
    1717
    18             <?php do_action( 'bp_footer' ) ?>
     18            <?php do_action( 'bp_in_footer' ); ?>
     19
    1920        </div><!-- #footer -->
    2021
    21         <?php do_action( 'bp_after_footer' ) ?>
     22        <?php do_action( 'bp_after_footer' ); ?>
    2223
    23         <?php wp_footer(); ?>
     24        <?php wp_footer(); // @see bp_footer(); ?>
    2425
    2526    </body>
  • trunk/bp-themes/bp-default/functions.php

    r5539 r5736  
    139139 */
    140140function bp_dtheme_enqueue_scripts() {
     141
    141142    // Bump this when changes are made to bust cache
    142143    $version = '20111023';
     
    158159        'remove_fav'        => __( 'Remove Favorite', 'buddypress' )
    159160    );
    160 
    161161    wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
     162
     163    // Maybe enqueue comment reply JS
     164    if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
     165        wp_enqueue_script( 'comment-reply' );
    162166}
    163167add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_scripts' );
  • trunk/bp-themes/bp-default/header.php

    r5733 r5736  
    33<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    44    <head profile="http://gmpg.org/xfn/11">
    5         <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ) ?>; charset=<?php bloginfo( 'charset' ) ?>" />
     5        <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
    66        <?php if ( current_theme_supports( 'bp-default-responsive' ) ) : ?><meta name="viewport" content="width=device-width, initial-scale=1.0"><?php endif; ?>
    77        <title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
     8        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    89
    9         <?php do_action( 'bp_head' ) ?>
     10        <?php wp_head(); // @see bp_head(); ?>
    1011
    11         <link rel="pingback" href="<?php bloginfo( 'pingback_url' ) ?>" />
    12 
    13         <?php
    14             if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
    15                 wp_enqueue_script( 'comment-reply' );
    16 
    17             wp_head();
    18         ?>
    1912    </head>
    2013
     
    2821                    <h1 id="logo" role="banner"><a href="<?php echo home_url(); ?>" title="<?php _ex( 'Home', 'Home page banner link title', 'buddypress' ); ?>"><?php bp_site_name(); ?></a></h1>
    2922
    30                         <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
     23                        <form action="<?php echo bp_search_form_action(); ?>" method="post" id="search-form">
    3124                            <label for="search-terms" class="accessibly-hidden"><?php _e( 'Search for:', 'buddypress' ); ?></label>
    3225                            <input type="text" id="search-terms" name="search-terms" value="<?php echo isset( $_REQUEST['s'] ) ? esc_attr( $_REQUEST['s'] ) : ''; ?>" />
    3326
    34                             <?php echo bp_search_form_type_select() ?>
     27                            <?php echo bp_search_form_type_select(); ?>
    3528
    36                             <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
     29                            <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ); ?>" />
    3730
    38                             <?php wp_nonce_field( 'bp_search_form' ) ?>
     31                            <?php wp_nonce_field( 'bp_search_form' ); ?>
    3932
    4033                        </form><!-- #search-form -->
    4134
    42                 <?php do_action( 'bp_search_login_bar' ) ?>
     35                <?php do_action( 'bp_search_login_bar' ); ?>
    4336
    4437                </div><!-- .padder -->
     
    4942            </div>
    5043
    51             <?php do_action( 'bp_header' ) ?>
     44            <?php do_action( 'bp_header' ); ?>
    5245
    5346        </div><!-- #header -->
    5447
    55         <?php do_action( 'bp_after_header' ) ?>
    56         <?php do_action( 'bp_before_container' ) ?>
     48        <?php do_action( 'bp_after_header'     ); ?>
     49        <?php do_action( 'bp_before_container' ); ?>
    5750
    5851        <div id="container">
Note: See TracChangeset for help on using the changeset viewer.