maddisondesigns / customizer-custom-controls

WordPress Customizer Custom Controls
403 stars 120 forks source link

Getting an error in Goole font custom control. #8

Closed jainnidhi closed 6 years ago

jainnidhi commented 6 years ago

Hello,

I am using your google font custom control and getting an error given below:

Trying to get property 'font' of non-object in line

$this->fontListIndex = $this-> skyrocket_getFontIndex( $this->fontList, $this->fontValues->font );

Trying to get property 'category' of non-object in line

<input type="hidden" class="google-fonts-category" value="<?php echo $this->fontValues->category; ?>">

Could you please help me?

Thanks in advance!

maddisondesigns commented 6 years ago

Make sure you've specified a default value when setting up your control. https://github.com/maddisondesigns/customizer-custom-controls/blob/master/inc/customizer.php#L746

Also, the default value should look something like this - https://github.com/maddisondesigns/customizer-custom-controls/blob/master/functions.php#L215

maddisondesigns commented 6 years ago

I presume you've been able to resolve your issue so I'm going to close this.