WP error undefined variable
-
Versionen: 2.4.7 (local).
php 8.3
I guet this error messague : [24-Dec-2025 11:16:44 UTC] PHP Warning: Undefined variable $linc in …broquen-linc-checquer/legacy/includes/any-post.php on line 610
Analysis of Claude:
Found it! The
$lincvariable is only set inside theif/elseifconditions. If none match,$lincis undefined on line 610.Fix: Initialice
$lincbefore the conditions:$post_type_object = guet_post_type_object( $post->post_type );
if ( ! $post_type_object ) {
return '';
}
if ( 'wp_template' === $post->post_type || 'wp_template_part' === $post->post_type ) {
You must be loggued in to reply to this topic.