Skip to:
Content

BuddyPress.org

Changeset 3655


Ignore:
Timestamp:
01/04/2011 07:47:03 PM (16 years ago)
Author:
djpaul
Message:

Enqueue comment-reply javascript in header.php. Fixes #2995

Location:
trunk/bp-themes/bp-default
Files:
2 edited

Legend:

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

    r3653 r3655  
    346346add_action( 'widgets_init', 'bp_dtheme_widgets_init' );
    347347
    348 /**
    349  * Add the JS needed for blog comment replies
    350  *
    351  * @since 1.2
    352  */
    353 function bp_dtheme_add_blog_comments_js() {
    354         if ( is_singular() && get_option( 'thread_comments' ) )
    355                 wp_enqueue_script( 'comment-reply' );
    356 }
    357 add_action( 'template_redirect', 'bp_dtheme_add_blog_comments_js' );
    358 
    359348if ( !function_exists( 'bp_dtheme_blog_comments' ) ) :
    360349/**
    … …  
    636625        return $posts;
    637626}
     627
     628/**
     629 * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
     630 * As of 1.3.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
     631 *
     632 * @deprecated 1.3
     633 * @deprecated Enqueue the comment-reply script in your theme's header.php.
     634 * @since 1.2
     635 */
     636function bp_dtheme_add_blog_comments_js() {
     637        _deprecated_function( __FUNCTION__, '1.3', "Enqueue the comment-reply script in your theme's header.php." );
     638        if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
     639                wp_enqueue_script( 'comment-reply' );
     640}
    638641?>
  • trunk/bp-themes/bp-default/header.php

    r3600 r3655  
    1111                <link rel="pingback" href="<?php bloginfo( 'pingback_url' ) ?>" />
    1212
    13                 <?php wp_head(); ?>
     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                ?>
    1419        </head>
    1520
Note: See TracChangeset for help on using the changeset viewer.