Changeset 2383703
- Timestamp:
- 09/17/2020 01:24:37 PM (6 years ago)
- File:
-
- 1 edited
-
kodeks-dashboard/trunk/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kodeks-dashboard/trunk/functions.php
r2273711 r2383703 710 710 */ 711 711 712 if ( ! function_exists( 'kodeks_search_join' ) ) { 712 $search_plugin = false; 713 if(in_array('acf-better-search/acf-better-search.php', apply_filters('active_plugins', get_option('active_plugins')))){ 714 $search_plugin = true; 715 }; 716 717 if ( ! function_exists( 'kodeks_search_join' ) && $search_plugin == false ) { 713 718 714 719 function kodeks_search_join( $join ) { … … 731 736 */ 732 737 733 if ( ! function_exists( 'kodeks_search_where' ) ) {738 if ( ! function_exists( 'kodeks_search_where' ) && $search_plugin == false ) { 734 739 function kodeks_search_where( $where ) { 735 740 global $pagenow, $wpdb; … … 746 751 } 747 752 748 /**753 /** 749 754 * Prevent duplicates 750 755 * 751 756 * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_distinct 752 757 */ 753 if ( ! function_exists( 'kodeks_search_distinct' )) {754 function kodeks_search_distinct( $where ) {755 global $wpdb;756 757 if ( is_search() ) {758 return "DISTINCT";759 }760 761 return $where;762 }763 add_filter( 'posts_distinct', 'kodeks_search_distinct' );764 }758 if ( ! function_exists( 'kodeks_search_distinct' ) && $search_plugin == false ) { 759 function kodeks_search_distinct( $where ) { 760 global $wpdb; 761 762 if ( is_search() ) { 763 return "DISTINCT"; 764 } 765 766 return $where; 767 } 768 add_filter( 'posts_distinct', 'kodeks_search_distinct' ); 769 } 765 770 766 771
Note: See TracChangeset
for help on using the changeset viewer.