Undefined Variable
-
Hey Smashballoon,
I am using version 2.0.1 of Custom Facebook Feed and I received this error:
Notice: Undefined variable: cff_item_styles in **CLIENT-SITE**/wp-content/plugins/custom-facebook-feed/custom-facebook-feed.php on line 1142
I believe that this is because the variable is declared within the if statement on line 469 of custom-facebook-feed.php. Since we are not using the style options in the admin pages, I am guessing that the if statement is false, the variable is never declared, and is then undefined when line 1142 is executed.
The solution that I am currently using is declaring the variable prior to the if statement as follows:
$cff_item_styles = ''; if( $cff_sep_color_check || $cff_post_bg_color_check ){ $cff_item_styles .= 'style="'; if($cff_sep_color_check && !$cff_post_bg_color_check) $cff_item_styles .= 'border-bottom: ' . $cff_sep_size . 'px solid #' . str_replace('#', '', $cff_sep_color) . '; '; if($cff_post_bg_color_check) $cff_item_styles .= 'background-color: ' . $cff_post_bg_color . '; '; if(isset($cff_post_rounded)) $cff_item_styles .= '-webkit-border-radius: ' . $cff_post_rounded . 'px; -moz-border-radius: ' . $cff_post_rounded . 'px; border-radius: ' . $cff_post_rounded . 'px; '; $cff_item_styles .= '"'; }Outside of this issue, the plugin’s functionality is fantastic. Well done.
The topic ‘Undefined Variable’ is closed to new replies.