dartiss / plugins-list

WordPress plugin to insert a list of the Wordpress plugins you are using into any post/page.
https://wordpress.org/plugins/plugins-list/
GNU General Public License v2.0
7 stars 6 forks source link

Fix author sort #18

Closed dgw closed 6 years ago

dgw commented 6 years ago

usort() replaces the array keys, so sorting $plugins with it made the key ($plugin_file) into just an integer. Checking whether an integer is an active plugin obviously fails. When I tested enabling author sorting, the list only contained the first entry, for some reason (it should have been empty).

Using uasort() instead preserves the array keys and lets the checks for whether each plugin is active work properly.

This will probably merge-conflict with #17, but I'm happy to rebase either PR for you if needed.

(Edit: Removed extra commits… not sure how those got in, but they're gone now.)

dartiss commented 6 years ago

Included as part of #21