cabrerahector/wordpress-popular-posts

Warning: Undefined variable $query in /plugins/wordpress-popular-posts/src/template-tags.php on line 157

Closed this issue · 1 comments

Describe the problem

Not sure about the intended use of the new $cache arg in wpp_get_views, but I get this warning when I use it

Warning: Undefined variable $query in /plugins/wordpress-popular-posts/src/template-tags.php on line 157

Steps to reproduce it

Use the wpp_get_views template tag on a page with cache = true, may not appear on first refresh, should appear the second time though.

if ( function_exists('wpp_get_views') ) {
    $wpp = wpp_get_views(
        $timber_post->ID,
        "last24hours",
	false,
	true
    );
}

Environment

  • Plugin version: 7.0.0
  • WordPress version: 6.2.1
  • PHP version: 8.0.23

Additional context

I've opened a pull request for this if that's useful:

#387

Fixed in #387