Skip to:
Content

Changeset 6679


Ignore:
Timestamp:
12/27/2012 04:13:04 PM (5 years ago)
Author:
boonebgorges
Message:

Ensure that directory/header buttons are hooked when doing AJAX

Directory buttons (such as Join Group) were previously added only when
!is_admin(), to avoid fatal errors in the Dashboard when certain template
functions were undefined. This caused problems when the directory was refreshed
using AJAX, because is_admin() returns true when making calls to
admin-ajax.php. This changeset does an additional check to make sure that
the buttons are added correctly when DOING_AJAX, even if is_admin() returns
true.

Fixes #4736

Props magnus78, sbrajesh

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress-functions.php

    r6607 r6679  
    100100        /** Buttons ***********************************************************/
    101101
    102         if ( !is_admin() ) {
     102        if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    103103            // Register buttons for the relevant component templates
    104104            // Friends button
  • trunk/bp-themes/bp-default/functions.php

    r6259 r6679  
    113113    }
    114114
    115     if ( !is_admin() ) {
     115    if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    116116        // Register buttons for the relevant component templates
    117117        // Friends button
Note: See TracChangeset for help on using the changeset viewer.