class-wc-widget-product-search.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Product Search Widget.
  4. *
  5. * @package WooCommerce/Widgets
  6. * @version 2.3.0
  7. */
  8. defined( 'ABSPATH' ) || exit;
  9. /**
  10. * Widget product search class.
  11. */
  12. class WC_Widget_Product_Search extends WC_Widget {
  13. /**
  14. * Constructor.
  15. */
  16. public function __construct() {
  17. $this->widget_cssclass = 'woocommerce widget_product_search';
  18. $this->widget_description = __( 'A search form for your store.', 'woocommerce' );
  19. $this->widget_id = 'woocommerce_product_search';
  20. $this->widget_name = __( 'Product Search', 'woocommerce' );
  21. $this->settings = array(
  22. 'title' => array(
  23. 'type' => 'text',
  24. 'std' => '',
  25. 'label' => __( 'Title', 'woocommerce' ),
  26. ),
  27. );
  28. parent::__construct();
  29. }
  30. /**
  31. * Output widget.
  32. *
  33. * @see WP_Widget
  34. *
  35. * @param array $args Arguments.
  36. * @param array $instance Widget instance.
  37. */
  38. public function widget( $args, $instance ) {
  39. $this->widget_start( $args, $instance );
  40. get_product_search_form();
  41. $this->widget_end( $args );
  42. }
  43. }