My Custom Widget Not Work – WordPress 4.3
-
After update my wordpress widget stopped working. How fix ?
Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct()
<?php class Whatsapp extends WP_Widget { public function __construct() { $id_base = 'whatsapp'; $name = 'Whatsapp'; $widget_options = array('description' => 'WhatsApp'); parent::__construct($id_base, $name, $widget_options); } public function form($instance) { } public function update($new_instance, $old_instance) { } public function widget($args, $instance) { echo '<div class="whatsapp"style="padding:10px 20px; background-color:#2ab200; border-radius:4px; color:#FFF; font-size:14px; font-weight:bold font-family: sans-serif; margin-top:20px; height:41px; "><img src="https://www.valedosolfm.com.br/wp-content/uploads/2015/08/whats.png"><p style="margin:0; padding:0; position:relative; bottom: 26px; color#FFF; float:right; font-weight:bold; font-family: sans-serif;">43 9648-4713</p></div>'; } } function register_whatsapp(){ //Registra o widget que criamos register_widget( 'Whatsapp' ); } //Com fun??o add_action, atribuimos uma fun??o, usando o gancho widgets_init add_action( 'widgets_init', 'register_whatsapp' ); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘My Custom Widget Not Work – WordPress 4.3’ is closed to new replies.