Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#55499 closed enhancement (fixed)

$pagenow is used but not define in documentation of this function add_customize_screen_to_heartbeat_settings()

Reported by: jontyravi's profile jontyravi Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch needs-refresh
Focuses: docs Cc:

Description

global $pagenow is used add_customize_screen_to_heartbeat_settings($settings) in this function. But it is not mentioned in the documentation of the function.

Attachments (3)

55499.patch (445 bytes) - added by jontyravi 3 years ago.
I have added patch of this ticket
55499.2.patch (443 bytes) - added by jontyravi 3 years ago.
55499.3.diff (738 bytes) - added by bhrugesh12 3 years ago.

Download all attachments as: .zip

Change History (9)

@jontyravi
3 years ago

I have added patch of this ticket

@jontyravi
3 years ago

#1 @bhrugesh12
3 years ago

  • Type changed from defect (bug) to enhancement

Add doc comment for $global variable $pagenow. Find the latest attachment.

@bhrugesh12
3 years ago

#2 @kebbet
3 years ago

  • Keywords needs-refresh added

A search for string $pagenow in the src-directory gives that global variables should be declared between the since-tag and the param-tags in the docblock.

Something like

* Filters heartbeat settings for the Customizer.
*
* @since 4.9.0
*
* @global string $pagenow Description
*
* @param array $settings Current settings to filter.

#3 @kebbet
3 years ago

  • Version changed from 5.8 to 4.9

#4 @SergeyBiryukov
3 years ago

  • Component changed from General to Customize
  • Milestone changed from Awaiting Review to 6.0

Hi there, thanks for the patches!

I think we should add the missing @global tag but may want to skip the description for now, as this global is also used in other methods of the same class, as well as many other areas of core, and should probably have a consistent description everywhere.

#5 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 53059:

Docs: Consistently document the $pagenow global in WP_Customize_Manage methods.

Follow-up to [41839].

Props jontyravi, bhrugesh12, kebbet.
Fixes #55499.

#6 @SergeyBiryukov
3 years ago

In 53060:

Docs: Add missing description for $pagenow global in various functions.

See #54729, #55499.

Note: See TracTickets for help on using tickets.