aiwoo_shortcode_search

The WooCommerce Menu Extension aiwoo shortcode search function.

Description

aiwoo_shortcode_search( $atts, (null) $content = null ); 

Parameters (2)

0. $atts
The atts.
1. $content — Optional. (null) => null
The content.

Usage

  1. if ( !function_exists( 'aiwoo_shortcode_search' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-menu-extension/include/frontend.inc.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = aiwoo_shortcode_search($atts, $content); 
  12.  

Defined (1)

The function is defined in the following location(s).

/include/frontend.inc.php  
  1. function aiwoo_shortcode_search( $atts, $content = null ) { 
  2. global $woocommerce; 
  3. $atts = shortcode_atts(array( 
  4. "button" => "Search",  
  5. ), $atts ); 
  6.  
  7. $content = $content != '' ? $content : __( 'Search Products*' ); 
  8. $search = '<form action="'.esc_url( home_url( '/' ) ).'" class="woocommerce-product-search" method="get" role="search"> 
  9. <input type="search" title="'.esc_attr_x( 'Search for:', 'label' ).'" name="s" value="'.get_search_query().'" placeholder="'.$content.'" class="search-field"> 
  10. <input type="submit" value="'.$atts['button'].'"> 
  11. <input type="hidden" value="product" name="post_type"> 
  12. </form>'; 
  13. return $search;