| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | $placeholder = isset($attributes['placeholder']) ? $attributes['placeholder'] : 'Search for Topics....'; |
| 10 | 10 | $submit_btn_type = isset($attributes['submit_btn_type']) ? $attributes['submit_btn_type'] : 'icon'; |
| 11 | 11 | $submit_btn_text = isset($attributes['submit_btn_text']) ? $attributes['submit_btn_text'] : __('Search', 'forumax'); |
| 12 | 12 | $submit_btn_align = isset($attributes['submit_btn_align']) ? $attributes['submit_btn_align'] : 'left'; |
| 13 | - $submit_btn_icon = isset($attributes['submit_btn_icon']) ? $attributes['submit_btn_icon'] : ['value' => 'fas fa-search', 'library' => 'solid']; | |
| 13 | + $submit_btn_icon = isset($attributes['submit_btn_icon']) ? $attributes['submit_btn_icon'] : ['value' => 'fas fa-search', 'library' => 'fa-solid']; | |
| 14 | 14 | $is_keywords = isset($attributes['is_keywords']) ? $attributes['is_keywords'] : true; |
| 15 | 15 | $keywords_label = isset($attributes['keywords_label']) ? $attributes['keywords_label'] : 'Popular:'; |
| 16 | 16 | $keywords_align = isset($attributes['keywords_align']) ? $attributes['keywords_align'] : 'center'; |
| 17 | 17 | $keywords = isset($attributes['keywords']) ? $attributes['keywords'] : [['title' => 'Keyword #1'], ['title' => 'Keyword #2']]; |
| @@ -39,12 +39,12 @@ | ||
| 39 | 39 | wp_register_style( 'bbpc-el-widgets', FORUMAX_STYLES . 'frontend/el-widgets.css', array(), FORUMAX_VERSION ); |
| 40 | 40 | } |
| 41 | 41 | wp_enqueue_style( 'bbpc-el-widgets' ); |
| 42 | 42 | |
| 43 | - wp_enqueue_script( 'bbpc-frontend-js', FORUMAX_FRONT_ASS . 'js/frontend.js', array( 'jquery' ), FORUMAX_VERSION, true ); | |
| 43 | + wp_enqueue_script( 'bbpc-frontend', FORUMAX_FRONT_ASS . 'js/frontend.js', array( 'jquery' ), FORUMAX_VERSION, true ); | |
| 44 | 44 | |
| 45 | 45 | // Localize AJAX data for the search script. |
| 46 | - wp_localize_script( 'bbpc-frontend-js', 'forumax_localize_script', array( | |
| 46 | + wp_localize_script( 'bbpc-frontend', 'forumax_localize_script', array( | |
| 47 | 47 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
| 48 | 48 | 'nonce' => wp_create_nonce( 'forumax-nonce' ), |
| 49 | 49 | ) ); |
| 50 | 50 | |
| @@ -57,9 +57,9 @@ | ||
| 57 | 57 | <div <?php echo $wrapper_attributes; ?>> |
| 58 | 58 | <div class="bbpc-search-overlay" data-widget-id="<?php echo esc_attr( $widget_id ); ?>"></div> |
| 59 | 59 | |
| 60 | 60 | <form |
| 61 | - action="<?php echo esc_url( home_url( '/' ) ); ?>" | |
| 61 | + action="<?php echo esc_url( bbp_get_search_url() ); ?>" | |
| 62 | 62 | role="search" |
| 63 | 63 | method="get" |
| 64 | 64 | class="bbpc_search_form_wrapper" |
| 65 | 65 | data-widget-id="<?php echo esc_attr( $widget_id ); ?>" |
| @@ -85,9 +85,12 @@ | ||
| 85 | 85 | ?> |
| 86 | 86 | </button> |
| 87 | 87 | </span> |
| 88 | 88 | |
| 89 | - <input type='search' id="<?php echo esc_attr( $input_id ); ?>" class="frmx-search-input" autocomplete="off" name="s" | |
| 89 | + <!-- bbPress search request sentinel --> | |
| 90 | + <input type="hidden" name="action" value="bbp-search-request" /> | |
| 91 | + | |
| 92 | + <input type='search' id="<?php echo esc_attr( $input_id ); ?>" class="frmx-search-input" autocomplete="off" name="bbp_search" | |
| 90 | 93 | placeholder="<?php echo esc_attr( $placeholder ); ?>" |
| 91 | 94 | data-post-type="<?php echo esc_attr( $search_post_type ); ?>" |
| 92 | 95 | data-highlight="<?php echo esc_attr( $search_highlight ); ?>" |
| 93 | 96 | data-ajax-search="<?php echo esc_attr( $is_ajax_search ); ?>" |
| @@ -104,15 +107,11 @@ | ||
| 104 | 107 | <!-- WPML Language Code --> |
| 105 | 108 | <?php if (defined('ICL_LANGUAGE_CODE')): ?> |
| 106 | 109 | <input type="hidden" name="lang" value="<?php echo esc_attr(ICL_LANGUAGE_CODE); ?>" /> |
| 107 | 110 | <?php endif; ?> |
| 108 | - | |
| 109 | - <?php if ( ! empty( $search_post_type ) ) : ?> | |
| 110 | - <input type="hidden" id="<?php echo esc_attr( $post_type_id ); ?>" name="post_type" value="<?php echo esc_attr( $search_post_type ); ?>" /> | |
| 111 | - <?php endif; ?> | |
| 112 | 111 | </div> |
| 113 | 112 | </div> |
| 114 | - <div id="<?php echo esc_attr( $result_id ); ?>" class="bbpc-search-result-container" data-noresult="<?php esc_attr_e( 'No Results Found', 'forumax' ); ?>"></div> | |
| 113 | + <div id="<?php echo esc_attr( $result_id ); ?>" class="bbpc-search-result-container" data-noresult="<?php esc_attr_e( 'No Results Found', 'forumax' ); ?>" data-noresult-hint="<?php esc_attr_e( 'Check the spelling or try a different word or phrase.', 'forumax' ); ?>"></div> | |
| 115 | 114 | |
| 116 | 115 | <?php if ($is_keywords): ?> |
| 117 | 116 | <?php if ( $is_pro_active ): ?> |
| 118 | 117 | <div class="bbpc-search-keyword"> |