| 1 | <?php |
||
| 22 | class Search_Shortcode { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Constructor. |
||
| 26 | * |
||
| 27 | * @since 1.1.0 |
||
| 28 | */ |
||
| 29 | public function __construct() { |
||
| 30 | add_shortcode( 'wpeo_search', array( $this, 'callback_wpeo_search' ) ); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Handle search shortcode. |
||
| 35 | * |
||
| 36 | * @param array $atts Attributes used by the shortcode. |
||
| 37 | * |
||
| 38 | * @since 1.1.0 |
||
| 39 | */ |
||
| 40 | public function callback_wpeo_search( $atts ) { |
||
| 41 | $atts = shortcode_atts( array( |
||
| 42 | 'label' => '', |
||
| 43 | 'slug' => '', |
||
| 44 | 'name' => 'id', |
||
| 45 | 'id' => '', |
||
| 46 | 'type' => 'post', |
||
| 47 | 'icon' => '', |
||
| 48 | 'value' => '', |
||
| 49 | 'args' => array(), |
||
| 50 | ), $atts, 'wpeo_search' ); |
||
| 51 | |||
| 52 | Search_Class::g()->display( $atts ); |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 57 |