Fatal error: Uncaught Error: Call to a member function is_search() on bool
-
i have a custom page template, where i show all sales items.
it threw following error:
Fatal error: Uncaught Error: Call to a member function is_search() on bool in ./wp-includes/query.php:703 Stack trace: #0 ./wp-content/plugins/facebook-for-woocommerce/facebook-commerce-events-tracker.php(378): is_search() #1 ./wp-includes/class-wp-hook.php(303): WC_Facebookcommerce_EventsTracker->inject_search_event(Object(WP_Query)) #2 ./wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #3 ./wp-includes/plugin.php(518): WP_Hook->do_action(Array) #4 ./wp-includes/class-wp-query.php(1784): do_action_ref_array('pre_get_posts', Array) #5 ./wp-includes/class-wp-qu in ./wp-includes/query.php on line 703
inside
facebook-commerce-events-tracker.php
i changed
public function inject_search_event() {
to
public function inject_search_event($query) {
and
if ( ! $this->is_pixel_enabled() ) {
to
if ( ! $this->is_pixel_enabled() || ! $query->is_main_query() ) {
to solve the issue.
- The topic ‘Fatal error: Uncaught Error: Call to a member function is_search() on bool’ is closed to new replies.