小编Ham*_*ini的帖子

致命错误:在非对象上调用成员函数check_capabilities()

我在functions.php中编写了这段代码,为我的主题个性化添加了一个部分.但是当我想打开"localhost/wordpress/wp-admin/customize.php?theme = eye-theme"来查看我的结果时,我看到了这个错误:

致命错误:check_capabilities()在第233行的C:\ xampp\htdocs\xampp\wordpress\wp-includes\class-wp-customize-control.php中调用非对象的成员函数

这是我的functions.php:

<?php

function eyetheme_register_theme_customizer($wp_customizer) {

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

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

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

}
add_action('customize_register', 'eyetheme_register_theme_customizer');
Run Code Online (Sandbox Code Playgroud)

php wordpress wordpress-theming

3
推荐指数
1
解决办法
4877
查看次数

标签 统计

php ×1

wordpress ×1

wordpress-theming ×1