When saving a nav-menu I get error message about undefined variables in plugin
-
Hi,
Whan I save a nav-menu (on wp-admin/nav-menus.php), I get an error message:
Notice: Trying to get property of non-object in /usr/share/nginx/html/ort-site-2019/wp-content/plugins/video-embed-thumbnail-generator/video-embed-thumbnail-generator.php on line 7123
Theis error message is repeated for every item in the menu.
The code on that line is:if ( $options['template'] == "gentle" && strpos($post->post_mime_type, "video") !== false ) {
And it seems that the non-object is the $post.
Suggested solution:
Adding an isset check of the $post variable seems to solve the error:
if ( $options['template'] == "gentle" && isset($post) && strpos($post->post_mime_type, "video") !== false ) {
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘When saving a nav-menu I get error message about undefined variables in plugin’ is closed to new replies.