When saving a nav-menu I get error messages about undefined variables in plugin
-
Hi,
Whan I save a nav-menu (on wp-admin/nav-menus.php), I get error messages:
Notice: Undefined variable: youtube_details in /wp-content/plugins/automatic-featured-images-from-videos/automatic-featured-images-from-videos.php on line 137
Notice: Undefined variable: vimeo_details in /wp-content/plugins/automatic-featured-images-from-videos/automatic-featured-images-from-videos.php on line 137
These error messages are repeated for every item in the menu.
The source of the error
It seems that the code is trying to use the
$youtube_details
and$vimeo_detail
variables, but those aren’t defined since their definition occurs inside conditions that aren’t met:
if ( $youtube_id )
and
if ( $vimeo_id )
Suggested Solution
I’m actually surprised that this function,
wds_check_if_content_contains_video
, would run at all in the admin page of the nav-menus. But if it does have to run, then maybe a check forisset
of those variable would be in place.Such that line 137 would have the following code:
&& ( (isset($youtube_details) && $youtube_details) || ( $vimeo_details) )
Thanks
- The topic ‘When saving a nav-menu I get error messages about undefined variables in plugin’ is closed to new replies.