Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#40636 closed defect (bug) (duplicate)

Can you have duplicate hook names?

Reported by: chunkford's profile chunkford Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.4
Component: General Keywords:
Focuses: Cc:

Description

do_action( 'quick_edit_custom_box' ... can be found in the below files:

class-wp-posts-list-table.php - Line 1743
class-wp-terms-list-table.php - Line 616

I'm querying it as one has 2 (class-wp-posts-list-table.php) inputs while the other has 3 (class-wp-terms-list-table.php)

This fills the debug.log with errors when you want to use the hook in in class-wp-terms-list-table.php as the class-wp-posts-list-table.php hook produces Missing argument and Undefined variable errors.

Change History (1)

#1 @johnbillion
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report, @chunkford!

The short answer is that yes you can have duplicate hook names (as noted by the line preceding the action in class-wp-terms-list-table.php).

However, it is indeed a bug that the two instances of this hook pass different parameters. We're already tracking that issue (along with others) in #38462.

If you want to follow along with #38462 then you can click the star next to the title to receive notifications.

Note: See TracTickets for help on using tickets.