Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#42270 closed defect (bug) (fixed)

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

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

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 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 @behzod
9 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
9 years ago

  • Milestone Awaiting Review → 4.9

#3 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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.