Php 自定义程序的Wordpress问题
我正在学习如何在WordPress中创建一个徽标上传器,这样我就可以使用定制器将自己的徽标上传到WordPress网站 警告:call_user_func_array()要求参数1为有效回调,在第298行的/Users/brandonpowell/sites/valet/wordpress development/web/wp/wp includes/class-wp-hook.php中未找到函数“wpt_register_theme_customizer”,或者函数名无效 我会在每一篇教程和博客文章中发布如何创建徽标上传,每次我都会遇到相同的错误消息。有人可以解释给我什么是最好的方法来创建一个标志上传Php 自定义程序的Wordpress问题,php,wordpress,Php,Wordpress,我正在学习如何在WordPress中创建一个徽标上传器,这样我就可以使用定制器将自己的徽标上传到WordPress网站 警告:call_user_func_array()要求参数1为有效回调,在第298行的/Users/brandonpowell/sites/valet/wordpress development/web/wp/wp includes/class-wp-hook.php中未找到函数“wpt_register_theme_customizer”,或者函数名无效 我会在每一篇教程和博
function wpt_register_theme_customizer( $wp_customize ) {
// Add Custom Logo Settings
$wp_customize->add_section( 'custom_logo' , array(
'title' => __('Change Your Logo','wptthemecustomizer'),
'panel' => 'design_settings',
'priority' => 20
) );
$wp_customize->add_setting(
'wpt_logo',
array(
'default' => get_template_directory_uri() . '/images/logo.png',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new My_Customize_Image_Reloaded_Control(
$wp_customize,
'custom_logo',
array(
'label' => __( 'Change Logo', 'wptthemecustomizer' ),
'section' => 'custom_logo',
'settings' => 'wpt_logo',
'context' => 'wpt-custom-logo'
)
)
);
}
add_action( 'customize_register', 'wpt_register_theme_customizer' );
您是否在此文件中使用
命名空间
?如果是这样,您需要在函数名中包含名称空间,如下所示:
add_action( 'customize_register', __NAMESPACE__ . '\\wpt_register_theme_customizer' );
请看一下这个-->