感谢@birgire在评论中的提示,我找到了两件事,一个实现示例包括context
, 这里(还需要注意的是,Github gist提供了访问以前从该上下文上传的任何图像的非常有用的功能的代码!
https://gist.github.com/eduardozulian/4739075
/**
* Example of inserting a section called "Branding" with a
* context-based image uploader
*/
$wp_customize->add_section( \'my_branding\', array(
\'title\' => __( \'Branding\', \'\' ),
\'priority\' => 30,
) );
$wp_customize->add_setting( \'my_logo\', array(
\'capability\' => \'edit_theme_options\'
) );
$wp_customize->add_control( new My_Customize_Image_Reloaded_Control( $wp_customize, \'my_logo\', array(
\'label\' => __( \'Logo\', \'\' ),
\'section\' => \'my_branding\',
\'settings\' => \'my_logo\',
\'context\' => \'my-custom-logo\'
) ) );