Patch for fixing notices and warnings
-
polylang-1.6.5
I got some errors when using with my plugin Polylang – Translate URL Rewrite Slugs but I’m sure it could help for others circumstances.
I had an additional “isset” to the function
parse_query
of the filefrontend/frontend.php
.The patch
diff --git a/frontend/frontend.php b/frontend/frontend.php index 61bd775..84c5bd3 100644 --- a/frontend/frontend.php +++ b/frontend/frontend.php @@ -103,7 +103,9 @@ class PLL_Frontend extends PLL_Base { $query->set('post_type', 'post'); // do we query another custom taxonomy? - $taxonomies = array_diff(wp_list_pluck($query->tax_query->queries, 'taxonomy'), array('language', 'category', 'post_tag')); + $taxonomies = array(); + if (isset($query->tax_query->queries)) + $taxonomies = array_diff(wp_list_pluck($query->tax_query->queries, 'taxonomy'), array('language', 'category', 'post_tag')); // unset the is_archive flag for language pages to prevent loading the archive template // keep archive flag for comment feed otherwise the language filter does not work
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Patch for fixing notices and warnings’ is closed to new replies.