From 9b40a4f79fa2aebd9a4d5093f340cebda58462ee Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 4 Jul 2015 20:28:17 +0000 Subject: [PATCH] Deprecate PHP4 style contructor in Twenty Eleven's Ephemera widget. See #31982. Props Frank Klein. Fixes #32881. git-svn-id: https://develop.svn.wordpress.org/trunk@33085 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyeleven/inc/widgets.php | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/wp-content/themes/twentyeleven/inc/widgets.php b/src/wp-content/themes/twentyeleven/inc/widgets.php index 7d60f7056a..8aedabf274 100644 --- a/src/wp-content/themes/twentyeleven/inc/widgets.php +++ b/src/wp-content/themes/twentyeleven/inc/widgets.php @@ -13,13 +13,15 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { /** - * Constructor + * PHP5 constructor. * - * @since Twenty Eleven 1.0 - **/ - function Twenty_Eleven_Ephemera_Widget() { - $widget_ops = array( 'classname' => 'widget_twentyeleven_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ) ); - $this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops ); + * @since Twenty Eleven 2.2 + */ + function __construct() { + parent::__construct( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), array( + 'classname' => 'widget_twentyeleven_ephemera', + 'description' => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ), + ) ); $this->alt_option_name = 'widget_twentyeleven_ephemera'; add_action( 'save_post', array( &$this, 'flush_widget_cache' ) ); @@ -27,6 +29,16 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { add_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) ); } + /** + * PHP4 constructor. + * + * @since Twenty Eleven 1.0 + */ + function Twenty_Eleven_Ephemera_Widget() { + _deprecated_constructor( 'Twenty_Eleven_Ephemera_Widget', '4.3.0' ); + self::__construct(); + } + /** * Outputs the HTML for this widget. *