PHP Warning: Undefined variable $disabled …
-
Getting these warnings in
debug.logwith Yoast SEO plugin active.[28-Oct-2025 12:35:11 UTC] PHP Warning: Undefined variable $disabled in .../wp-content/plugins/job-postings/admin/settings.php on line 1254Current code:
if( !class_exists('WPSEO_Admin') ){
$disabled = "disabled";
}
echo '<option '.$disabled.' value="yoast_seo" '.selected($fs, 'yoast_seo', false).'>'.__('Yoast SEO', 'job-postings').'</option>';A fix could be similar to this (just add the first line):
$disabled = '';
if( !class_exists('WPSEO_Admin') ){
$disabled = "disabled";
}
echo '<option '.$disabled.' value="yoast_seo" '.selected($fs, 'yoast_seo', false).'>'.__('Yoast SEO', 'job-postings').'</option>';Job Postings 2.7.17, WordPress 6.7.4, PHP 8.2.x
You must be logged in to reply to this topic.