Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42270 closed defect (bug) (fixed)

PHPDoc blocks of register_widget and unregister_widget are not up-to-date

Reported by: behzod's profile behzod Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Widgets Keywords: has-patch
Focuses: docs Cc:

Description

register_widget and unregister_widget functions can accept either the name of a WP_Widget subclass or an instance of a WP_Widget subclass since 4.6.0 (see WP_Widget_Factory::register() and WP_Widget_Factory::unregister()) but the PHPDoc blocks are not up-to-date.

Attaching a patch that improves the documentation. It also refactors functions per WP coding standards.

Attachments (1)

42270.patch (1.6 KB) - added by behzod 7 years ago.

Download all attachments as: .zip

Change History (4)

@behzod
7 years ago

#1 @behzod
7 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 4.9

#3 @SergeyBiryukov
7 years ago

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

In 41942:

Docs: After [37329], update the documentation for register_widget() and unregister_widget().

Both functions can accept a WP_Widget instance object instead of a WP_Widget subclass name, same as WP_Widget_Factory::register() and ::unregister().

Props behzod.
Fixes #42270.

Note: See TracTickets for help on using tickets.