Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39148 closed enhancement (fixed)

Correct concatenated dynamic hooks

Reported by: keesiemeijer Owned by: johnbillion
Priority: normal Milestone: 4.7.1
Component: General Version:
Severity: normal Keywords: has-patch
Cc: Focuses: docs

Description

Cleaning up concatenated dynamic hooks as per the coding-standards

Related: #38462

Attachments (1)

39148.patch (10.0 KB ) - added by keesiemeijer 10 years ago.
Use interpolation for naming of dynamic hooks

Download all attachments as: .zip

Change History (10)

@keesiemeijer
10 years ago

Use interpolation for naming of dynamic hooks

#1 @keesiemeijer
10 years ago

  • Keywords has-patch added

#2 @MaximeCulea
10 years ago

  • Component GeneralFormatting
  • Keywords 2nd-opinion dev-feedback added
  • Versiontrunk

Hi @keesiemeijer,
It's a good idea, but that means cleaning a lot of current hooks :confused:
Moreover, I've heard that when formatting and/or coding standards are in, rather than applying to all curent application it's preferable to only apply on new tickets.

#3 @keesiemeijer
10 years ago

I understand, but the documentation in the code reference relies on the hook names to be correct. For a fun example look here: https://developer.wordpress.org/reference/hooks/handle_bulk_actions-get_current_screen-id/

Should I create separate tickets for all of them?

#4 @keesiemeijer
10 years ago

  • Component FormattingGeneral

#5 @MaximeCulea
10 years ago

@keesiemeijer no need, but better wait for a core-team point of view ;)

#6 @johnbillion
10 years ago

  • Keywords 2nd-opinion dev-feedback removed
  • Milestone Awaiting Review4.8
  • Version trunk

Thanks for the patch, @keesiemeijer.

These dynamic hook names are indeed incorrect. Here's an example of where the hook name gets messed up on the code reference:

https://developer.wordpress.org/reference/hooks/handle_bulk_actions-get_current_screen-id/

#7 @ocean90
10 years ago

#39193 was marked as a duplicate.

#8 @johnbillion
10 years ago

  • Milestone 4.84.7.1
  • Owner set to johnbillion
  • Status newreviewing
  • Summary Clean up of concatenated dynamic hooksCorrect concatenated dynamic hooks

#9 @johnbillion
10 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 39600:

General: Use interpolation instead of concatenation for all dynamic hook names.

This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148

Note: See TracTickets for help on using tickets.