Skip to:

Opened 7 years ago

Closed 4 years ago

Last modified 2 years ago

#2696 closed defect (fixed)

Double usage of action 'bbp_author_metabox'

Reported by: cyrilbatillat Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.4
Component: API - Actions/Filters Keywords:



I just stumbled on 2 different action hooks carrying the same name : 'bbp_author_metabox'. This hook is triggered at 2 places :

  • Just after author metabox registration, via function author_metabox() in /includes/admin/topics.php
  • During rendering of Author metabox, via bbp_author_metabox() function in /includes/admin/metaboxes.php

So, trying to display additionnal fields in the author metabox, your code will be displayed two times : at the very top of the page, and in the metabox.

Change History (5)

#1 @netweb
7 years ago

  • Keywords needs-patch added

Thanks for the ticket and at a quick glance you are correct.

A probable work around at the moment would be to use some bbPress conditionals, bbp_is_topic_edit(), bbp_is_reply_edit(), is_admin(), is_bbPress() etc,

Will need to dig around a research this a bit to see what plugins may already be using these hooks so we don't break any back compat.

#2 @netweb
6 years ago

  • Milestone changed from Awaiting Review to 2.7

#3 @netweb
4 years ago

  • Keywords needs-patch removed
  • Milestone changed from 2.7 to 2.6
  • Resolution set to fixed
  • Status changed from new to closed

This has just been fixed as part of r6197

#4 @ryanhellyer
4 years ago

I stumbled across this just now.

If anyone needs to work around this before 2.6 is out, you can do so by putting

if ( ! did_action( 'admin_head' ) ) {

before your output.

I don't think the suggestions above for other conditionals would work.

Last edited 4 years ago by ryanhellyer (previous) (diff)

#5 @johnjamesjacoby
2 years ago

Assigning all closed & unassigned tickets in the 2.6 milestone to myself.

Note: See TracTickets for help on using tickets.