Plugin Directory

Changeset 3071960


Ignore:
Timestamp:
04/16/2024 08:56:21 PM (2 years ago)
Author:
pavlo.opanasenko
Message:

Version 1.8.1

Location:
searchwp-live-ajax-search
Files:
15 edited
2 copied

Legend:

Unmodified
Added
Removed
  • searchwp-live-ajax-search/tags/1.8.1/includes/class-template.php

    r3067168 r3071960  
    11<?php
     2
     3use SearchWP\Utils as SearchWP_Utils;
    24
    35// Exit if accessed directly.
     
    141143        $results = $data['query']->posts;
    142144
    143         $data['query_args']['posts__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
     145        $data['query_args']['post__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
    144146
    145147        query_posts( $data['query_args'] ); // phpcs:ignore WordPress.WP.DiscouragedFunctions.query_posts_query_posts
     
    164166
    165167        $args = [
    166             's'              => $data['query_args']['s'],
    167             'post_status'    => 'publish',
    168             'post_type'      => get_post_types(
    169                 [
    170                     'public'              => true,
    171                     'exclude_from_search' => false,
    172                 ]
    173             ),
    174             'posts_per_page' => $data['query_args']['per_page'],
     168            'post_status'      => 'any',
     169            'post_type'        => $this->get_engine_post_types(),
     170            'posts_per_page'   => $data['query_args']['per_page'],
     171            'orderby'          => 'post__in',
     172            'suppress_filters' => true,
    175173        ];
    176174
    177175        $results = $data['query']->get_results();
    178176
    179         $args['posts__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
     177        $args['post__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
    180178
    181179        query_posts( $args ); // phpcs:ignore WordPress.WP.DiscouragedFunctions.query_posts_query_posts
     
    184182
    185183        load_template( $data['template'], true, false );
     184    }
     185
     186    /**
     187     * Get the post types to query.
     188     *
     189     * @since 1.8.1
     190     *
     191     * @return array
     192     */
     193    private function get_engine_post_types() {
     194
     195        $global_engine_sources = SearchWP_Utils::get_global_engine_source_names();
     196
     197        $post_types = [];
     198
     199        foreach ( $global_engine_sources as $global_engine_source ) {
     200            $indicator = 'post' . SEARCHWP_SEPARATOR;
     201            if ( $indicator === substr( $global_engine_source, 0, strlen( $indicator ) ) ) {
     202                $post_types[] = substr( $global_engine_source, strlen( $indicator ) );
     203            }
     204        }
     205
     206        return $post_types;
    186207    }
    187208
  • searchwp-live-ajax-search/tags/1.8.1/package.json

    r3067168 r3071960  
    11{
    22  "name": "searchwp-live-ajax-search",
    3   "version": "2.0.0",
    4   "description": "",
     3  "version": "1.8.1",
     4  "description": "Enhance your search forms with live search, powered by SearchWP (if installed)",
    55  "main": "assets/javascript/src/searchwp-live-ajax-search.js",
    66  "scripts": {
  • searchwp-live-ajax-search/tags/1.8.1/readme.txt

    r3067175 r3071960  
    44Requires at least: 4.8
    55Tested up to: 6.5
    6 Stable tag: 1.8.0
     6Stable tag: 1.8.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Screenshots ==
    6969
    70 1. SearchWP Live Ajax Search automatically working in Twenty Fourteen instantly after activating
    71 2. Search results with default 'theme' (can be completely (completely) customized)
    72 3. SearchWP Live Ajax Search Widget
    73 4. SearchWP Live Ajax Search Widget Advanced
     701. SearchWP Live Ajax Search Results dropdown
     712. SearchWP Live Ajax Search Settings page
     723. SearchWP Live Ajax Search Forms settings page
     734. SearchWP Live Ajax Search Forms embed options
    7474
    7575== Changelog ==
     76
     77= 1.8.1 =
     78* Fixes incorrect results when using a Live Search custom template in some cases.
    7679
    7780= 1.8.0 =
  • searchwp-live-ajax-search/tags/1.8.1/searchwp-live-ajax-search.php

    r3067168 r3071960  
    44Plugin URI: https://searchwp.com/
    55Description: Enhance your search forms with live search, powered by SearchWP (if installed)
    6 Version: 1.8.0
     6Version: 1.8.1
    77Requires PHP: 5.6
    88Author: SearchWP, LLC
     
    3737     * @since 1.7.0
    3838     */
    39     define( 'SEARCHWP_LIVE_SEARCH_VERSION', '1.8.0' );
     39    define( 'SEARCHWP_LIVE_SEARCH_VERSION', '1.8.1' );
    4040}
    4141
  • searchwp-live-ajax-search/trunk/includes/class-template.php

    r3067168 r3071960  
    11<?php
     2
     3use SearchWP\Utils as SearchWP_Utils;
    24
    35// Exit if accessed directly.
     
    141143        $results = $data['query']->posts;
    142144
    143         $data['query_args']['posts__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
     145        $data['query_args']['post__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
    144146
    145147        query_posts( $data['query_args'] ); // phpcs:ignore WordPress.WP.DiscouragedFunctions.query_posts_query_posts
     
    164166
    165167        $args = [
    166             's'              => $data['query_args']['s'],
    167             'post_status'    => 'publish',
    168             'post_type'      => get_post_types(
    169                 [
    170                     'public'              => true,
    171                     'exclude_from_search' => false,
    172                 ]
    173             ),
    174             'posts_per_page' => $data['query_args']['per_page'],
     168            'post_status'      => 'any',
     169            'post_type'        => $this->get_engine_post_types(),
     170            'posts_per_page'   => $data['query_args']['per_page'],
     171            'orderby'          => 'post__in',
     172            'suppress_filters' => true,
    175173        ];
    176174
    177175        $results = $data['query']->get_results();
    178176
    179         $args['posts__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
     177        $args['post__in'] = ! empty( $results ) ? wp_list_pluck( $results, 'ID' ) : [ 0 ];
    180178
    181179        query_posts( $args ); // phpcs:ignore WordPress.WP.DiscouragedFunctions.query_posts_query_posts
     
    184182
    185183        load_template( $data['template'], true, false );
     184    }
     185
     186    /**
     187     * Get the post types to query.
     188     *
     189     * @since 1.8.1
     190     *
     191     * @return array
     192     */
     193    private function get_engine_post_types() {
     194
     195        $global_engine_sources = SearchWP_Utils::get_global_engine_source_names();
     196
     197        $post_types = [];
     198
     199        foreach ( $global_engine_sources as $global_engine_source ) {
     200            $indicator = 'post' . SEARCHWP_SEPARATOR;
     201            if ( $indicator === substr( $global_engine_source, 0, strlen( $indicator ) ) ) {
     202                $post_types[] = substr( $global_engine_source, strlen( $indicator ) );
     203            }
     204        }
     205
     206        return $post_types;
    186207    }
    187208
  • searchwp-live-ajax-search/trunk/package.json

    r3067168 r3071960  
    11{
    22  "name": "searchwp-live-ajax-search",
    3   "version": "2.0.0",
    4   "description": "",
     3  "version": "1.8.1",
     4  "description": "Enhance your search forms with live search, powered by SearchWP (if installed)",
    55  "main": "assets/javascript/src/searchwp-live-ajax-search.js",
    66  "scripts": {
  • searchwp-live-ajax-search/trunk/readme.txt

    r3067175 r3071960  
    44Requires at least: 4.8
    55Tested up to: 6.5
    6 Stable tag: 1.8.0
     6Stable tag: 1.8.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Screenshots ==
    6969
    70 1. SearchWP Live Ajax Search automatically working in Twenty Fourteen instantly after activating
    71 2. Search results with default 'theme' (can be completely (completely) customized)
    72 3. SearchWP Live Ajax Search Widget
    73 4. SearchWP Live Ajax Search Widget Advanced
     701. SearchWP Live Ajax Search Results dropdown
     712. SearchWP Live Ajax Search Settings page
     723. SearchWP Live Ajax Search Forms settings page
     734. SearchWP Live Ajax Search Forms embed options
    7474
    7575== Changelog ==
     76
     77= 1.8.1 =
     78* Fixes incorrect results when using a Live Search custom template in some cases.
    7679
    7780= 1.8.0 =
  • searchwp-live-ajax-search/trunk/searchwp-live-ajax-search.php

    r3067168 r3071960  
    44Plugin URI: https://searchwp.com/
    55Description: Enhance your search forms with live search, powered by SearchWP (if installed)
    6 Version: 1.8.0
     6Version: 1.8.1
    77Requires PHP: 5.6
    88Author: SearchWP, LLC
     
    3737     * @since 1.7.0
    3838     */
    39     define( 'SEARCHWP_LIVE_SEARCH_VERSION', '1.8.0' );
     39    define( 'SEARCHWP_LIVE_SEARCH_VERSION', '1.8.1' );
    4040}
    4141
Note: See TracChangeset for help on using the changeset viewer.