| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | public function get_search_results() { |
| 28 | 28 | global $wpdb; |
| 29 | 29 | $search_input = isset( $_POST['search_input'] ) ? sanitize_text_field( $_POST['search_input'] ) : ''; |
| 30 | 30 | $search_cat = isset( $_POST['search_cat'] ) ? wp_strip_all_tags( $_POST['search_cat'] ) : ''; |
| 31 | - $lang = isset( $_POST['lang'] ) ? wp_strip_all_tags( $_POST['lang'] ) : ''; | |
| 31 | + $lang = isset( $_POST['lang'] ) ? wp_strip_all_tags( $_POST['lang'] ) : ''; | |
| 32 | 32 | $search_input = preg_replace( '/[^A-Za-z0-9_\- ][]]/', '', strtolower( $search_input ) ); |
| 33 | 33 | |
| 34 | 34 | $tax_query = []; |
| 35 | 35 | if ( $search_cat ) { |
| @@ -58,9 +58,9 @@ | ||
| 58 | 58 | ]; |
| 59 | 59 | |
| 60 | 60 | if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) { |
| 61 | 61 | $args['suppress_filters'] = false; |
| 62 | - $args['lang'] = ICL_LANGUAGE_CODE; | |
| 62 | + $args['lang'] = ICL_LANGUAGE_CODE; | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $search_results = $this->query->get_posts( $args ); |
| 66 | 66 | |
| @@ -205,7 +205,11 @@ | ||
| 205 | 205 | ] ); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | public function render( $atts, $content = null ) { |
| 209 | + betterdocs()->assets->localize( 'betterdocs-search', 'betterdocsSearchConfigTwo', [ | |
| 210 | + 'is_post_type_archive' => is_post_type_archive( 'docs' ), | |
| 211 | + ] ); | |
| 212 | + | |
| 209 | 213 | $this->views( 'shortcodes/search' ); |
| 210 | 214 | } |
| 211 | 215 | } |