Code snippet wrong after upgrading PHP7.4 to PHP8.2
-
I am using a code snippet, that was provided on WPBeginners by WPCode. But the snippet not working anymore after upgrading to PHP8.2
So the plugin correctly indicates an error (on the line printed in bold?!), but I hope someone can help why the code is not valid anymore.The code is to create a shortcut to display todays date:
function wpb_date_today($atts, $content = null) {
extract( shortcode_atts( array(
‘format’ => ”
), $atts ) );if ($atts[‘format’] == ”) {
$date_time .= date(get_option(‘date_format’));
} else {
$date_time .= date($atts[‘format’]);
}
return $date_time;
}
add_shortcode(‘date-today’,’wpb_date_today’);The page I need help with: [log in to see the link]
- The topic ‘Code snippet wrong after upgrading PHP7.4 to PHP8.2’ is closed to new replies.