WordPress.org

Make WordPress Core

Opened 12 months ago

Closed 8 months ago

Last modified 8 months ago

#47052 closed enhancement (fixed)

code consistency on hooks using string + variable

Reported by: arena Owned by: 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 12 months ago.
patch
##.JPG (52.7 KB) - added by arena 11 months ago.
undercore missing
47052.diff (6.2 KB) - added by desrosj 8 months ago.

Download all attachments as: .zip

Change History (8)

@arena
12 months ago

patch

#1 @desrosj
11 months 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
11 months ago

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

Last edited 11 months ago by arena (previous) (diff)

@arena
11 months ago

undercore missing

@desrosj
8 months ago

#3 follow-up: @desrosj
8 months 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
8 months 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
8 months 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.