Creating default object from empty value in Theme Customizer – wp_customize?

I have the following code on lines 315 and 316 of my theme file Customizer.php. For some reason I get an error in my error_log file at the root of the installation. However everything seems to be working fine.

 $wp_customize->get_panel('widgets')->title = __( 'Widgets' );
 $wp_customize->get_panel('widgets')->priority = 4;

This is the error:

PHP Warning: Creating default object with empty value in /wp-content/themes/theme/inc/customizer.php at line 315 PHP Warning: Creating default object with empty value in /wp-content/themes/theme/inc/customizer. php on line 316

What is wrong with the above code?

Leave a Comment