Changeset 2728752
- Timestamp:
- 05/23/2022 05:28:34 PM (4 years ago)
- File:
-
- 1 edited
-
wpsso-wc-metadata/tags/1.13.1/lib/search.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsso-wc-metadata/tags/1.13.1/lib/search.php
r2653897 r2728752 60 60 public function filter_posts_search( $search, $wp_query ) { 61 61 62 if ( $this->p->debug->enabled ) { 63 64 $this->p->debug->mark(); 65 } 66 62 67 if ( ! $wp_query->is_main_query() ) { 63 68 … … 71 76 $product_ids = $this->get_search_product_ids( $wp_query->saved_search_s[ 's' ] ); // Returns an array. 72 77 78 if ( $this->p->debug->enabled ) { 79 80 $this->p->debug->log_arr( 'product_ids', $product_ids ); 81 } 82 73 83 if ( empty( $product_ids ) ) { 74 84 … … 87 97 88 98 $search = $matches[ 1 ] . '(' . $matches[ 2 ] .') ' . $post_id_query . $matches[ 3 ]; 99 } 100 101 if ( $this->p->debug->enabled ) { 102 103 $this->p->debug->log( 'search string = ' . $search ); 89 104 } 90 105 … … 97 112 private function get_search_product_ids( $s ) { 98 113 114 if ( $this->p->debug->enabled ) { 115 116 $this->p->debug->mark(); 117 } 118 99 119 $product_ids = array(); 100 120 … … 124 144 private function get_search_post_ids( $s ) { 125 145 146 if ( $this->p->debug->enabled ) { 147 148 $this->p->debug->mark(); 149 } 150 126 151 global $wpdb; 127 152 … … 165 190 $db_query .= ');'; 166 191 192 if ( $this->p->debug->enabled ) { 193 194 $this->p->debug->log( 'db query = ' . $db_query ); 195 } 196 167 197 $post_ids = $wpdb->get_col( $db_query ); 168 198 … … 171 201 172 202 private function get_sql_meta_keys() { 203 204 if ( $this->p->debug->enabled ) { 205 206 $this->p->debug->mark(); 207 } 173 208 174 209 $md_config = WpssoWcmdConfig::get_md_config(); … … 187 222 } 188 223 224 if ( $this->p->debug->enabled ) { 225 226 $this->p->debug->log_arr( 'sql_meta_keys', $sql_meta_keys ); 227 } 228 189 229 return $sql_meta_keys; 190 230 } … … 192 232 private function get_parsed_search_terms( $terms ) { 193 233 194 $checked = array(); 234 if ( $this->p->debug->enabled ) { 235 236 $this->p->debug->mark(); 237 } 238 239 $search_terms = array(); 195 240 196 241 foreach ( $terms as $term ) { … … 216 261 } 217 262 218 $checked[] = $term; 219 } 220 221 return $checked; 263 $search_terms[] = $term; 264 } 265 266 if ( $this->p->debug->enabled ) { 267 268 $this->p->debug->log_arr( 'search_terms', $search_terms ); 269 } 270 271 return $search_terms; 222 272 } 223 273 }
Note: See TracChangeset
for help on using the changeset viewer.