PluginProbe ʕ •ᴥ•ʔ
FiboSearch – Ajax Search for WooCommerce / 1.9.0
FiboSearch – Ajax Search for WooCommerce v1.9.0
trunk 0.9 0.9.1 1.0 1.0.1 1.0.2 1.0.3 1.0.3.1 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.10.0 1.11.0 1.12.0 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.18.0 1.18.1 1.19.0 1.2.0 1.2.1 1.20.0 1.21.0 1.22.3 1.23.0 1.24.0 1.25.0 1.26.1 1.27.0 1.28.0 1.28.1 1.29.0 1.3.0 1.3.1 1.3.2 1.3.3 1.30.0 1.31.0 1.32.0 1.32.1 1.32.2 1.33.0 1.4.0 1.4.1 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.9.0
ajax-search-for-woocommerce / widget.php
ajax-search-for-woocommerce Last commit date
assets 5 years ago composer 5 years ago fs 5 years ago includes 5 years ago languages 5 years ago partials 5 years ago vendor 5 years ago ajax-search-for-woocommerce.php 5 years ago readme.txt 5 years ago widget.php 5 years ago wpml-config.xml 5 years ago
widget.php
74 lines
1 <?php
2
3
4 // Exit if accessed directly
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 if ( class_exists( 'WC_Widget' ) ) {
10
11
12 add_action( 'widgets_init', function () {
13 register_widget( 'DGWT_WCAS_Search_Widget' );
14 } );
15
16 class DGWT_WCAS_Search_Widget extends WC_Widget {
17
18 /**
19 * Constructor
20 */
21 public function __construct() {
22
23
24 $this->widget_cssclass = 'woocommerce dgwt-wcas-widget';
25 $this->widget_description = __( 'AJAX (live) search form for WooCommerce', 'ajax-search-for-woocommerce' );
26 $this->widget_id = 'dgwt_wcas_ajax_search';
27 $this->widget_name = __( 'FiboSearch bar', 'ajax-search-for-woocommerce' );
28 $this->settings = array(
29 'title' => array(
30 'type' => 'text',
31 'std' => '',
32 'label' => __( 'Title', 'ajax-search-for-woocommerce' )
33 ),
34 'layout' => array(
35 'type' => 'select',
36 'std' => 'default',
37 'options' => array(
38 'default' => __( 'Default', 'ajax-search-for-woocommerce' ),
39 'classic' => __( 'Search bar only', 'ajax-search-for-woocommerce' ),
40 'icon' => __( 'Search icon', 'ajax-search-for-woocommerce' ),
41 'icon-flexible' => __( 'Icon on mobile, search bar on desktop', 'ajax-search-for-woocommerce' ),
42 ),
43 'label' => __( 'Layout', 'ajax-search-for-woocommerce' )
44 )
45 );
46
47 parent::__construct();
48 }
49
50
51 /**
52 * Outputs the content of the widget
53 *
54 * @param array $args
55 * @param array $instance
56 */
57 public function widget( $args, $instance ) {
58
59 $this->widget_start( $args, $instance );
60
61 $layoutParam = '';
62 if ( ! empty( $instance['layout'] ) && in_array( $instance['layout'], array( 'classic', 'icon', 'icon-flexible' ) ) ) {
63 $layoutParam = ' layout="' . $instance['layout'] . '"';
64 }
65
66 echo do_shortcode( '[wcas-search-form' . $layoutParam . ']' );
67
68 $this->widget_end( $args );
69 }
70
71 }
72
73 }
74