Changeset 2839264
- Timestamp:
- 12/26/2022 08:28:27 AM (4 years ago)
- Location:
- auto-search-suggestion/trunk
- Files:
-
- 2 edited
-
auto-search-suggestion.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
auto-search-suggestion/trunk/auto-search-suggestion.php
r2578611 r2839264 4 4 Plugin URI: https://wordpress.org/plugins/auto-search-suggestion 5 5 Description: Showing suggestions on searching from wordpress admin. 6 Version: 5.0. 06 Version: 5.0.1 7 7 Author: biztechc 8 8 Author URI: https://www.appjetty.com/ 9 WordPress Tested up to: 5.89 WordPress Tested up to: 6.1.1 10 10 License: GPLv2 11 11 Text Domain: ass … … 254 254 $set_post_type = get_option('auto_post_type'); 255 255 256 if($current_screen->post_type!='' && in_array($current_screen->post_type,$set_post_type)) {256 if($current_screen->post_type!='' && !empty($set_post_type) && in_array($current_screen->post_type,$set_post_type)) { 257 257 wp_enqueue_script( 'jquery-ui-autocomplete' ); 258 258 ?> … … 401 401 } 402 402 403 $post_types = implode("','", $set_post_type_front);403 // $post_types = implode("','", $set_post_type_front); 404 404 $set_search_in_front = get_option('auto_search_in_front'); 405 405 $set_post_thumb_front = get_option('auto_post_thumb_front'); … … 422 422 ); 423 423 424 if ( isset($set_search_in_front) && @in_array( 'post_title',$set_search_in_front) && !in_array( 'post_content',$set_search_in_front) ) {424 if ( isset($set_search_in_front) && !empty($set_search_in_front) && @in_array( 'post_title',$set_search_in_front) && !in_array( 'post_content',$set_search_in_front) ) { 425 425 426 426 add_filter( 'posts_where', 'auto_suggest_title_like', 10, 2 ); … … 428 428 remove_filter( 'posts_where', 'auto_suggest_title_like', 10, 2 ); 429 429 430 } elseif ( isset($set_search_in_front) && ! in_array( 'post_title',$set_search_in_front) && @in_array( 'post_content',$set_search_in_front) ) {430 } elseif ( isset($set_search_in_front) && !empty($set_search_in_front) && !in_array( 'post_title',$set_search_in_front) && @in_array( 'post_content',$set_search_in_front) ) { 431 431 432 432 add_filter( 'posts_where', 'auto_suggest_content_like', 10, 2 ); … … 504 504 * Limit posts suggest search to post_tile only 505 505 */ 506 function auto_suggest_title_like( $where, &$wp_query ) {506 function auto_suggest_title_like( $where, $wp_query ) { 507 507 508 508 global $wpdb; … … 510 510 511 511 if ( !empty( $search_term ) ) { 512 $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'%' . esc_sql( like_escape( $search_term ) ) . '%\'';512 $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'%' . esc_sql( $wpdb->esc_like( $search_term ) ) . '%\''; 513 513 } 514 514 … … 525 525 526 526 if ( !empty( $search_term ) ) { 527 $where .= ' AND ' . $wpdb->posts . '.post_content LIKE \'%' . esc_sql( like_escape( $search_term ) ) . '%\'';527 $where .= ' AND ' . $wpdb->posts . '.post_content LIKE \'%' . esc_sql( $wpdb->esc_like( $search_term ) ) . '%\''; 528 528 } 529 529 -
auto-search-suggestion/trunk/readme.txt
r2578611 r2839264 3 3 Tags: search,search suggestion, auto search suggestion 4 4 Requires at least: 3.6.1 5 Tested up to: 5.86 Stable tag: 5.0. 05 Tested up to: 6.1.1 6 Stable tag: 5.0.1 7 7 License: GPLv2 or later 8 8 … … 41 41 42 42 == Changelog == 43 = 1.0.0 = 44 * First release. 45 = 2.0.0 = 46 * Front-end Page/Post search suggestions with other fields like Excerpt, Published Date and Thumbnail. 47 = 3.0.0 = 48 * Compatibility with latest WordPress version 5.3 49 = 3.1.0 = 50 * Make the data sanitize,validate and Escape. 51 = 3.1.1 = 52 * Compatibility with latest WordPress version 5.4 53 = 4.0.0 = 54 * Compatibility with latest WordPress version 5.5 43 = 5.0.1 = 44 * Compatibility with latest WordPress version 6.1.1 55 45 = 5.0.0 = 56 46 * Bug Fixed 57 47 * Compatibility with latest WordPress version 5.8 58 59 60 61 48 = 4.0.0 = 49 * Compatibility with latest WordPress version 5.5 50 = 3.1.1 = 51 * Compatibility with latest WordPress version 5.4 52 = 3.1.0 = 53 * Make the data sanitize,validate and Escape. 54 = 3.0.0 = 55 * Compatibility with latest WordPress version 5.3 56 = 2.0.0 = 57 * Front-end Page/Post search suggestions with other fields like Excerpt, Published Date and Thumbnail. 58 = 1.0.0 = 59 * First release.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](https://plugins.trac.wordpress.org/chrome/site/your_project_logo.png)