Error PHP 8
-
Hi i use thes widget with php code on php7.4 everything ok
with php 8 i have an error….
Warning: Undefined variable $post in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Attempt to read property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Undefined variable $post in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3
Warning: Attempt to read property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3My 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->name .'</li>'; } $output .= '</ul>'; echo $output; } ?>
What is wrong?
Please Help…. i m a noob in PHP
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Error PHP 8’ is closed to new replies.