Plugin Directory

Changeset 1245749


Ignore:
Timestamp:
09/15/2015 09:20:05 AM (11 years ago)
Author:
1fixdotio
Message:

Remove duplicate search results when WPML plugin is activated, THE RIGHT WAY.

Location:
media-search-enhanced
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • media-search-enhanced/tags/0.7.1/README.txt

    r1245205 r1245749  
    66Requires at least: 3.5
    77Tested up to: 4.3
    8 Stable tag: 0.7.0
     8Stable tag: 0.7.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666== Changelog ==
    6767
     68= 0.7.1 =
     69* Bug fix: Remove duplicate search results when WPML plugin is activated, THE RIGHT WAY.
     70
    6871= 0.7.0 =
    6972* Remove duplicate search results when WPML plugin is activated. Props [@joseluiscruz](https://wordpress.org/support/topic/minor-conflict-with-wpml-media-plugin).
  • media-search-enhanced/tags/0.7.1/media-search-enhanced.php

    r1245205 r1245749  
    1515 * Plugin URI:        http://1fix.io/media-search-enhanced
    1616 * Description:       Search through all fields in Media Library.
    17  * Version:           0.7.0
     17 * Version:           0.7.1
    1818 * Author:            1fixdotio
    1919 * Author URI:        http://1fix.io
  • media-search-enhanced/tags/0.7.1/public/class-media-search-enhanced.php

    r1245205 r1245749  
    2929     * @var     string
    3030     */
    31     const VERSION = '0.7.0';
     31    const VERSION = '0.7.1';
    3232
    3333    /**
     
    142142        // Rewrite the where clause
    143143        if ( ! empty( $vars['s'] ) && ( ( isset( $_REQUEST['action'] ) && 'query-attachments' == $_REQUEST['action'] ) || 'attachment' == $vars['post_type'] ) ) {
    144             $pieces['where'] .= " AND $wpdb->posts.post_type = 'attachment' AND ($wpdb->posts.post_status = 'inherit' OR $wpdb->posts.post_status = 'private')";
     144            $pieces['where'] = " AND $wpdb->posts.post_type = 'attachment' AND ($wpdb->posts.post_status = 'inherit' OR $wpdb->posts.post_status = 'private')";
     145
     146            if ( class_exists('WPML_Media') ) {
     147                global $sitepress;
     148                //get current language
     149                $lang = $sitepress->get_current_language();
     150                $pieces['where'] .= $wpdb->prepare( " AND t.element_type='post_attachment' AND t.language_code = %s ", $lang );
     151            }
    145152
    146153            if ( ! empty( $vars['post_parent'] ) ) {
  • media-search-enhanced/trunk/README.txt

    r1245205 r1245749  
    66Requires at least: 3.5
    77Tested up to: 4.3
    8 Stable tag: 0.7.0
     8Stable tag: 0.7.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6666== Changelog ==
    6767
     68= 0.7.1 =
     69* Bug fix: Remove duplicate search results when WPML plugin is activated, THE RIGHT WAY.
     70
    6871= 0.7.0 =
    6972* Remove duplicate search results when WPML plugin is activated. Props [@joseluiscruz](https://wordpress.org/support/topic/minor-conflict-with-wpml-media-plugin).
  • media-search-enhanced/trunk/media-search-enhanced.php

    r1245205 r1245749  
    1515 * Plugin URI:        http://1fix.io/media-search-enhanced
    1616 * Description:       Search through all fields in Media Library.
    17  * Version:           0.7.0
     17 * Version:           0.7.1
    1818 * Author:            1fixdotio
    1919 * Author URI:        http://1fix.io
  • media-search-enhanced/trunk/public/class-media-search-enhanced.php

    r1245205 r1245749  
    2929     * @var     string
    3030     */
    31     const VERSION = '0.7.0';
     31    const VERSION = '0.7.1';
    3232
    3333    /**
     
    142142        // Rewrite the where clause
    143143        if ( ! empty( $vars['s'] ) && ( ( isset( $_REQUEST['action'] ) && 'query-attachments' == $_REQUEST['action'] ) || 'attachment' == $vars['post_type'] ) ) {
    144             $pieces['where'] .= " AND $wpdb->posts.post_type = 'attachment' AND ($wpdb->posts.post_status = 'inherit' OR $wpdb->posts.post_status = 'private')";
     144            $pieces['where'] = " AND $wpdb->posts.post_type = 'attachment' AND ($wpdb->posts.post_status = 'inherit' OR $wpdb->posts.post_status = 'private')";
     145
     146            if ( class_exists('WPML_Media') ) {
     147                global $sitepress;
     148                //get current language
     149                $lang = $sitepress->get_current_language();
     150                $pieces['where'] .= $wpdb->prepare( " AND t.element_type='post_attachment' AND t.language_code = %s ", $lang );
     151            }
    145152
    146153            if ( ! empty( $vars['post_parent'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.