Plugin Directory

Changeset 2839264

Timestamp:
12/26/2022 08:28:27 AM (4 years ago)
Author:
biztechc
Message:

Compatibility with WordPress version 6.1.1

Location:
auto-search-suggestion/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • auto-search-suggestion/trunk/auto-search-suggestion.php

    r2578611 r2839264  
    44Plugin URI: https://wordpress.org/plugins/auto-search-suggestion
    55Description: Showing suggestions on searching from wordpress admin.
    6 Version: 5.0.0
     6Version: 5.0.1
    77Author: biztechc
    88Author URI: https://www.appjetty.com/
    9 WordPress Tested up to: 5.8
     9WordPress Tested up to: 6.1.1
    1010License: GPLv2
    1111Text Domain: ass
     
    254254        $set_post_type = get_option('auto_post_type');
    255255
    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)) {
    257257                wp_enqueue_script( 'jquery-ui-autocomplete' );
    258258                ?>
     
    401401        }
    402402
    403         $post_types = implode("','", $set_post_type_front);
     403        // $post_types = implode("','", $set_post_type_front);
    404404        $set_search_in_front = get_option('auto_search_in_front');
    405405        $set_post_thumb_front = get_option('auto_post_thumb_front');
     
    422422                );
    423423
    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) ) {
    425425
    426426                        add_filter( 'posts_where', 'auto_suggest_title_like', 10, 2 );
     
    428428                        remove_filter( 'posts_where', 'auto_suggest_title_like', 10, 2 );
    429429
    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) ) {
    431431
    432432                        add_filter( 'posts_where', 'auto_suggest_content_like', 10, 2 );
     
    504504 * Limit posts suggest search to post_tile only
    505505 */
    506 function auto_suggest_title_like( $where, &$wp_query ) {
     506function auto_suggest_title_like( $where, $wp_query ) {
    507507
    508508        global $wpdb;
     
    510510
    511511        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 ) ) . '%\'';
    513513        }
    514514       
     
    525525
    526526        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 ) ) . '%\'';
    528528        }
    529529       
  • auto-search-suggestion/trunk/readme.txt

    r2578611 r2839264  
    33Tags: search,search suggestion, auto search suggestion
    44Requires at least: 3.6.1
    5 Tested up to: 5.8
    6 Stable tag: 5.0.0
     5Tested up to: 6.1.1
     6Stable tag: 5.0.1
    77License: GPLv2 or later
    88
     
    4141
    4242== 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
    5545= 5.0.0 =
    5646* Bug Fixed
    5747* 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.