Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#47052 closed enhancement (fixed)

code consistency on hooks using string + variable

Reported by: arena's profile arena Owned by: desrosj's profile desrosj
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.2
Component: General Keywords: has-patch commit
Focuses: coding-standards Cc:

Description

most of hooks using a string and one or more variables are coded like this

"hook_string-{$variable}"

except some of them ...

the purpose of this ticket is

  • to adress the issue
  • to include this rule as a wordpress coding standard
  • to propose a patch for hooks not applying this rule

regards

ps :
and i need it to make a cross reference tool,
see first prototype here : https://blog.mailpress.org/hooks/wordpress-5-1/

Attachments (3)

#47052.patch (5.0 KB) - added by arena 5 years ago.
patch
##.JPG (52.7 KB) - added by arena 5 years ago.
undercore missing
47052.diff (6.2 KB) - added by desrosj 5 years ago.

Download all attachments as: .zip

Change History (8)

@arena
5 years ago

patch

#1 @desrosj
5 years ago

  • Focuses coding-standards added
  • Milestone changed from Awaiting Review to 5.3
  • Owner set to desrosj
  • Status changed from new to reviewing

Thanks for this, @arena.

For reference, here is the relevant part of the WordPress Core PHP coding standards.

#2 @arena
5 years ago

nice, for some reason there is a 'underscore' missing (see image)

Last edited 5 years ago by arena (previous) (diff)

@arena
5 years ago

undercore missing

@desrosj
5 years ago

#3 follow-up: @desrosj
5 years ago

  • Keywords commit added

#47052.patch is a refresh that applies cleanly to trunk.

Looks like the missing _ in the coding standards part of the handbook was fixed.

#4 @desrosj
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45881:

Coding Standards: Dynamic hooks should be named using interpolation not concatenation.

Props arena, desrosj.
Fixes #47052.

#5 in reply to: ↑ 3 @SergeyBiryukov
5 years ago

Replying to desrosj:

Looks like the missing _ in the coding standards part of the handbook was fixed.

Related: #meta4400

Note: See TracTickets for help on using tickets.