你失踪了_
在里面add_control
参数:settings
.这个settings
参数应为home_features_boxes_icon_\' . $i
此处为完整代码:
for ( $i = 1; $i < 7; $i++ ) :
$wp_customize->add_setting( \'home_features_boxes_icon_\' . $i, array(
\'default\' => \'\',
\'type\' => \'theme_mod\',
\'capability\' => \'edit_theme_options\',
\'sanitize_callback\' => \'esc_html\',
) );
$wp_customize->add_control( \'home_features_boxes_icon_\' . $i . \'_c\', array(
\'settings\' => \'home_features_boxes_icon_\' . $i,
\'section\' => \'home_features_boxes\',
\'type\' => \'text\',
\'label\' => esc_html__( $i . \' - Box Icon\', \'lucathemes\' ),
) );
endfor;
旁注:
esc_html
不是消毒功能。使用
sanitize_text_field
用于文本字段。