Hello i take advantage of a widget with php code
on php7.4 all the pieces okay
with php 8 i’ve an error….
Warning: Undefined variable $put up in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Try to learn property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Undefined variable $put up in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3
Warning: Try to learn property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3
My code:
<?php
if (get_the_terms($post->ID, 'ausstattung')) {
$taxonomy_ar = get_the_terms($post->ID, 'ausstattung');
echo "";
$output="<ul>";
foreach ($taxonomy_ar as $taxonomy_term) {
$output .= '<li>'. $taxonomy_term->identify .'</li>';
}
$output .= '</ul>';
echo $output;
}
?>
What’s incorrect?