#4736 closed defect (bug) (fixed)
"join group" and similar buttons missing in listings for ajax browsing
Reported by: | magnus78 | Owned by: | |
---|---|---|---|
Milestone: | 1.7 | Priority: | low |
Severity: | minor | Version: | |
Component: | Templates | Keywords: | has-patch |
Cc: |
Description
The "join group" button is missing in the groups listing when the content was fetched using ajax. This is because the ajax requests go through wp-admin/admin-ajax.php, and adding those buttons is protected by a is_admin() clause.
The same it true for other listings.
Attachments (2)
Change History (8)
#2
@
12 years ago
Instead removing if ( !is_admin() )
It will be a better approach to put the condition like this
if ( !is_admin()||(is_admin()&&defined('DOING_AJAX')) )
#4
@
12 years ago
- Milestone changed from Awaiting Review to 1.7
- Priority changed from normal to low
- Severity changed from normal to minor
We need the is_admin()
check because of some load-order problem that otherwise occur in the dashboard.
#5
@
12 years ago
- Resolution set to fixed
- Status changed from new to closed
(In [6679]) 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
proposed fix