【发布时间】:2016-12-07 06:57:58
【问题描述】:
【问题讨论】:
【问题讨论】:
这些在定制器预览中称为“可见的编辑快捷方式”。你应该在这里阅读更多关于它的信息:
https://make.wordpress.org/core/2016/11/10/visible-edit-shortcuts-in-the-customizer-preview/
它是选择性刷新的扩展:
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial( 'blogname', array(
'selector' => '.site-title a',
'render_callback' => 'twentyfifteen_customize_partial_blogname',
) );
$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
'selector' => '.site-description',
'render_callback' => 'twentyfifteen_customize_partial_blogdescription',
) );
渲染回调调用bloginfo( 'name' );和bloginfo( 'description' );的地方
https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-customizer/
也可以查看官方Customizer documentation
因此,基本上,如果您在自定义程序中进行了选择性刷新,这些将默认显示;)
【讨论】: