From 193dd63c47b850fc661439e6aaa08fb3753e6c80 Mon Sep 17 00:00:00 2001 From: Anthony Skelton Date: Sat, 6 Feb 2016 05:06:30 -0800 Subject: [PATCH] Updated processing of new widget to use construct function. --- halloween-store/halloween-store.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/halloween-store/halloween-store.php b/halloween-store/halloween-store.php index 3cac08b..8aa2e92 100644 --- a/halloween-store/halloween-store.php +++ b/halloween-store/halloween-store.php @@ -282,13 +282,12 @@ function halloween_store_register_widgets() { class hs_widget extends WP_Widget { //process our new widget - function hs_widget() { - + public function __construct() { $widget_ops = array( - 'classname' => 'hs-widget-class', - 'description' => __( 'Display Halloween Products','halloween-plugin' ) ); - $this->WP_Widget( 'hs_widget', __( 'Products Widget','halloween-plugin'), $widget_ops ); - + 'classname' => 'hs-widget-class', + 'description' => __('Display Halloween Products','halloween-plugin'), + ); + parent::__construct( 'hs_widget', __( 'Products Widget', 'halloween-plugin'), $widget_ops); } //build our widget settings form