• Updated Mk to 1.2.0 from 1.09 on a site I built on my test rig and was constantly getting the following error:

    Notice: Undefined variable: color in /wp-content/themes/mk/LNT-framework/customizer/customizer-options.php on line 182

    It was serious as it broke the resizing of the slider image on the homepage and then also completely broke the media library for uploads and several of my plugins that I use for image optimisation for whatever reason.

    Exploring the error showed this:

    /* option group */
    	$options['mk_slide_mask_color'] = array(
    	'id' => 'mk_slide_mask_color',
    	'label'   => __( 'Slides Mask Color', 'mk' ),
    	'section' => $section,
    	'type'    => 'color',
    	'default' => $color // hex
    	);

    It’s the code which sets the options for putting an overlaying colour to the homepage slider in the customiser.

    The problem is the last line in the array, as $color isn’t defined. As a workaround you can either change this to any hex code surrounded in single quote, define $color somewhere in the function or change it to $primary_color.

    Hope this helps anyone who gets this error while installing this theme.

  • The topic ‘Possible Bug in customizer-options.php in 1.2.0?’ is closed to new replies.