cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 83 forks source link

Documentation out-of-date #192

Closed mattmilburn closed 6 years ago

mattmilburn commented 6 years ago

Your wiki for this plugin demonstrates that the template tag should have the arguments passed in as a single query string. But this never worked for me and once I passed in all of the arguments in an array like the examples in WP admin will show, everything worked.

// Wrong (demonstrated in the wiki)
wpp_get_mostpopular("range=weekly&order_by=comments");

// Correct (found in the examples on plugin parameters page)
wpp_get_mostpopular(['range' => 'weekly', 'order_by'=>'comments']);

Or perhaps I'm misunderstanding? Anyway, just wanted to point that out. I just wasted a bunch of time discovering that on my own :)

cabrerahector commented 6 years ago

Hi Matt!

That's odd. I use the latter form because I like it better but passing an string should work just the same. I'll have a look at it as soon as possible, thanks for the notice.

cabrerahector commented 6 years ago

Hey Matt,

I just checked and this is what I got:

image

I get the exact same results when passing the parameters to the function using an array:

image

I ran this test on the Twenty Seventeen theme.

mattmilburn commented 6 years ago

Okay I resolved my own issue. Sorry, this theme I’m working on had a custom plugin that was conflicting with the Popular Posts plugin. Once I deactivated the conflicting plugin, my code started working. Thanks for your help @cabrerahector! Sorry for the confusion! 🙃

cabrerahector commented 6 years ago

Don't worry about it. I had the suspicion that it was something like that, it has happened in the past a couple of times.

Which plugin was causing the issue? I'd like to install it to find out what's going on and if possible add some preventive measures to keep it from messing up the plugin and/or ask its developer to fix whatever needs fixing.

mattmilburn commented 6 years ago

It was actually a custom plugin from a previous developer on my project. Nothing public, just someone's fancy way of letting admins manage widgets and Popular Posts was one that had specific handling in place within the custom plugin. I just had no idea it was creating filters if Popular Posts plugin was installed. Luckily, I can just remove all of that custom code and handle my own implementation.

So no worries, someone did confusing things on a private project and we don't need to support them :)