WordPress.org

Make WordPress Core

Opened 8 days ago

Last modified 21 hours ago

#48252 new defect (bug)

Consistent deprecation of PHP 4 constructors

Reported by: jrf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: trunk
Component: General Keywords: has-patch
Focuses: docs, coding-standards Cc:
PR Number:

Description

While testing a new sniff for WPCS, I ran into an number of inconsistencies in the use of the `_deprecated_constructor()` function.

In particular:

  • Missing @deprecated tags in the function docblock of some PHP4 constructors.
  • Some PHP4 constructors in (external) dependencies not being marked as deprecated.

The attached patches would fix these inconsistencies.

Previous ticket: #31982

Related: #41121

Attachments (3)

48252-docs-WP_Widget-PHP4-constructor.patch (1.3 KB) - added by jrf 8 days ago.
WP_Widget(_Factory): PHP4 constructor / missing @deprecated tags
48252-docs-Twenty-Eleven-PHP-4-constructor.patch (1.0 KB) - added by jrf 8 days ago.
Twenty Eleven: mark PHP-4 constructor as deprecated As per [33086], no call to _deprecated_constructor() is added as the theme can be used by WordPress versions from before the function was introduced.
48252-Pomo-Deprecate-PHP-4-style-constructors.patch (2.9 KB) - added by jrf 8 days ago.
Pomo: Deprecate PHP-4 style constructors

Download all attachments as: .zip

Change History (4)

@jrf
8 days ago

WP_Widget(_Factory): PHP4 constructor / missing @deprecated tags

@jrf
8 days ago

Twenty Eleven: mark PHP-4 constructor as deprecated As per [33086], no call to _deprecated_constructor() is added as the theme can be used by WordPress versions from before the function was introduced.

@jrf
8 days ago

Pomo: Deprecate PHP-4 style constructors

#1 @andraganescu
21 hours ago

Just noting that all these patches apply cleanly.

Note: See TracTickets for help on using tickets.