* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com * @support http://www.wpopal.com/questions/ */ class Opalestate_similar_properties_Widget extends WP_Widget{ public function __construct() { parent::__construct( // Base ID of your widget 'opalestate_similarproperties_widget', // Widget name will appear in UI esc_html__('Estate: Similar Properties', 'opalestate-pro'), // Widget description array( 'description' => esc_html__( 'Similar Properties By Same Types and Status Of the post', 'opalestate-pro' ), ) ); } public function widget( $args, $instance ) { extract( $args ); extract( $instance ); //Check $tpl = OPALESTATE_THEMER_WIDGET_TEMPLATES .'widgets/similar-properties.php'; $tpl_default = OPALESTATE_PLUGIN_DIR .'templates/widgets/similar-properties.php'; if( is_file($tpl) ) { $tpl_default = $tpl; } require $tpl_default; } // Form public function form( $instance ) { //Set up some default widget settings. $defaults = array( 'title' => esc_html__('Similar Properties', 'opalestate-pro'), 'num' => '5' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>