2 PHP Errors on Latest Version
-
Undefined array key 0 in wp-content/plugins/media-library-organizer/includes/global/class-media-library-organizer-common.php:453as well as in
wp-content/plugins/media-library-organizer/includes/global/class-media-library-organizer-media.php:202
This is when you’re trying to check if someone is logged in as an administrator. You’re assuming the wp_get_current_user->roles array is non-empty. It can be empty in a MultiSite environment where a network administrator is viewing the dashboard of a site the aren’t technically a member of (but should still be able to access).
Be sure to check if the roles array is populated before accessing roles[0]. But looking at roles[0] is pretty loose, anyway. At a minimum, I’d suggest using something like in_array.
if (in_array(‘administrator’, $user_roles)) { ….
You must be logged in to reply to this topic.