Fatal error: Call to a member function check_capabilities() on a non-object

admin

Administrator
Staff member
I've written this code in functions.php to add a section to my theme personalization.
But when I want to open "localhost/wordpress/wp-admin/customize.php?theme=eye-theme" to see my result, I see this error:

<blockquote>
Fatal error: Call to a member function
Code:
check_capabilities()
on a non-object in C:\xampp\htdocs\xampp\wordpress\wp-includes\class-wp-customize-control.php on line 233
</blockquote>

This is my <strong>functions.php</strong>:

Code:
&lt;?php

function eyetheme_register_theme_customizer($wp_customizer) {

    $wp_customizer-&gt;add_section(
        'eyetheme_display_options',
        array(
            'title'     =&gt; 'Display Options',
            'priority'  =&gt; 200
        )
    );

    $wp_customizer-&gt;add_setting(
        'eyetheme_link_color',
        array(
            'default'   =&gt; '#000000',
            'transport' =&gt; 'postMessage'
       )
    );

    $wp_customizer-&gt;add_control(
        'eyetheme_link_control',
        array(
            'section'   =&gt; 'eyetheme_display_options',
            'label'     =&gt; 'Link Color',
            'type'      =&gt; 'text'
       )
    );

}
add_action('customize_register', 'eyetheme_register_theme_customizer');