If get_option( 'blogkori_theme_options' )
doesn’t have a value you’re not going to get an array back, which means that $options['googanalytics']
isn’t valid. You’ll need to account for this possibility.
You could do that by checking if googleanalytics
is set, and setting it to a new variable, or an empty string if it’s not set:
$options = get_option( 'blogkori_theme_options' );
$googleanalytics = isset( $options['googleanalytics'] ) ? $options['googleanalytics'] : '';
Then you would just echo $googleanalytics
in the textarea:
<textarea id="blogkori_theme_options[googanalytics]" class="large-text" cols="50" rows="5" name="blogkori_theme_options[googanalytics]" onclick="this.focus();this.select()"><?php echo esc_textarea( $googanalytics ); ?></textarea>