Opened 12 months ago
Last modified 3 days ago
#20801 closed defect (bug)
Deprecating PHP4-style constructors gracefully — at Initial Version
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Widgets | Version: | 3.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | ian.dunn@… |
Description
The class WP_Widget in wp-includes/widget.php makes use of PHP4-style constructor for compatibility with plugins (mostly).
I propose two changes here:
- A direct call to the old constructor should trigger a deprecation notice
- The PHP4-style constructor *must* be declared after construct() otherwise, an E_STRICT regarding constructor re-declaration is thrown.
Please find a patch attached...
Note: See
TracTickets for help on using
tickets.

diff patch