Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Undefined variable: $role

$
0
0

Replies: 0

Not sure when this came up or how it came up but it did. I have this error popping up a few times:

PHP Notice: Undefined variable: role in /wp-content/plugins/editor-menu-and-widget-access/admin/menus.php on line 13

If for whatever reason ( in theory every user should have roles ) this conditional is false:

if ( ! empty( $user->roles ) && is_array( $user->roles ) )

It throws an error. One solution to this would be to just declare $role at above the conditional at the top of the function as $role = false since it’s checking against specific roles. Just a thought, otherwise is a great plugin!


Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>