• Resolved Austin Adamson

    (@austin-adamson)


    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.

    https://ww.wp.xz.cn/plugins/custom-facebook-feed/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author smashballoon

    (@smashballoon)

    Hey Austin,

    Thanks for letting me know about the issue. I’ll get this cleaned up in the next update.

    Apologies for the inconvenience,

    John

    Plugin Author smashballoon

    (@smashballoon)

    Hey Austin,

    I just released version 2.1 which contains this fix. Thanks again for letting me know about it.

    John

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined Variable’ is closed to new replies.