path = dirname( __file__ ); // Widget variable settings. $this->cssclass = 'contact-info'; $this->description = __( 'Quickly add contact info to your sidebar e.g. address, phone, email.','spyropress' ); $this->id_base = 'spyropress_contact'; $this->name = __( 'Contact Info', 'spyropress' ); // Templates $this->templates['view-one'] = array( 'view' => 'view.php', 'label' =>__( 'Big Icons','spyropress' ) ); $this->templates['view-two'] = array( 'view' => 'view-two.php', 'label' =>__( 'Box Icons','spyropress' ) ); // Fields $this->fields = array( array( 'label' => __( 'Template','spyropress' ), 'id' => 'template', 'class' => 'enable_changer section-full', 'type' => 'select', 'options' => $this->get_option_templates() ), array( 'label' => __( 'Address', 'spyropress' ), 'id' => 'address', 'type' => 'textarea', 'rows' => 3 ), array( 'label' => __( 'Email', 'spyropress' ), 'id' => 'email', 'type' => 'text', ), array( 'label' => __( 'Business Hours', 'spyropress' ), 'id' => 'business_hours', 'type' => 'text', ), array( 'label' => __( 'Phone', 'spyropress' ), 'id' => 'phone', 'type' => 'text', ) ); $this->create_widget(); } function widget( $args, $instance ){ // extracting info extract( $args ); $template = isset($instance['template']) ? $instance['template'] : ''; // get view to render require( $this->get_view($template) ); } } //register class Spyropress_Module_contact spyropress_builder_register_module( 'Spyropress_Module_contact' ); ?>