From 16709683ae1f4967037fccee128657d8c7a96c98 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Fri, 14 Aug 2020 13:38:14 -0300 Subject: [PATCH] Do not uses global search if Tainacan plugin is not installed. --- src/functions.php | 2 +- src/template-parts/list-post.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functions.php b/src/functions.php index fb9ac05..549e592 100644 --- a/src/functions.php +++ b/src/functions.php @@ -192,7 +192,7 @@ add_action( 'admin_head', 'tainacan_customize_editor_css'); */ function tainacan_include_items_in_search_results( $query ) { - if ( $query->get( 'post_type' ) !== 'tainacan-collection' && !$_GET['onlyposts'] && !$_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin()) { + if ( defined ('TAINACAN_VERSION') && $query->get( 'post_type' ) !== 'tainacan-collection' && !$_GET['onlyposts'] && !$_GET['onlypages'] && $query->is_main_query() && $query->is_search() && ! is_admin()) { $collections_post_types = \Tainacan\Repositories\Repository::get_collections_db_identifiers(); $existing_post_types = $query->get( 'post_type' ); diff --git a/src/template-parts/list-post.php b/src/template-parts/list-post.php index 2caaaea..47bf5d3 100644 --- a/src/template-parts/list-post.php +++ b/src/template-parts/list-post.php @@ -1,5 +1,5 @@ labels->singular_name; @@ -15,7 +15,7 @@
- +