Undefined key “id” (with fix)
-
Recently installed the plugin. It works alright but it quickly produced an undefined array key error from PlainMenuItem.php at line 40.
I saw someone else had the issue here but it was closed, obviously without solving the problem.
Here is the file path:
/wp-content/plugins/getwid-megamenu/includes/blocks/PlainMenuItem.phpIf you have the issue, change line 40 to this:
$is_active = $attributes[‘kind’] == ‘post-type’ && isset($attributes[‘id’]) && $attributes[‘id’] === get_the_ID();This isset($attributes[‘id’]) is the important part as it will return false if the id doesn’t exist. That will stop the error from appearing. There are more attributes that need an isset added. I haven’t done it for all but it seems to be working fine.
- You must be logged in to reply to this topic.