你可以使用active_callback
属性以根据当前预览屏幕委派剖面可见性。
$wp_customize->add_section( \'my-section\',
array(
\'title\' => __( \'Section Title\' ),
\'active_callback\' => \'is_shop\',
) );
或自定义
$wp_customize->add_section( \'my-section\',
array(
\'title\' => __( \'Section Title\' ),
\'active_callback\' => \'is_custom_condition\',
) );
function is_custom_condition(){
$condition_is_met = //Some boolean returning logic;
if( ! $condition_is_met ){
return false;
}
return true;
}