Removing PHP4 Compatibility in WordPress Custom Widgets
read more
Categories

Removing PHP4 Compatibility in WordPress Custom Widgets


There I was. Working on adding PHP docblocks to widgets.php in /wp-includes, like you do, when I came across this:

So I set about trying to figure out the appropriate @since parameter to use. Do I base the @since on when the WP_Widget function was first added (2.8)? Or from when the time it was downgraded to a PHP4 compatibility wrapper for the __construct function (3.2)? I decided to ask the almighty Ben Lobaugh, my dev lead, to see what he thought. And Ben says:

I think you should erase the PHP4 constructor as PHP5 is required by WP now and submit it in another patch.

Done! Patch created and ticket submitted. That was easy.