如何保存通过在wordpress主题剪切器中扩展wp_customize_控件类添加的两个输入框数据
我使用下面的代码在我的主题定制器中添加了两个输入框如何保存通过在wordpress主题剪切器中扩展wp_customize_控件类添加的两个输入框数据,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我使用下面的代码在我的主题定制器中添加了两个输入框 class Koble_Kus_Custom_Stack_Input_Customizer extends WP_Customize_Control { public $type = 'stacked_input'; public function __construct( $manager, $id, $args = [] ) { parent::__construct( $manager,
class Koble_Kus_Custom_Stack_Input_Customizer extends WP_Customize_Control {
public $type = 'stacked_input';
public function __construct( $manager, $id, $args = [] )
{
parent::__construct( $manager, $id, $args );
}
public function enqueue()
{
wp_enqueue_style(
'hero-section-main-css',
get_template_directory_uri() . '/inc/customizer/css/hero-section-main-css.css'
);
}
public function render_content() {
?>
<div>
<div class="hero-content-col">
<h4>Column one</h4>
<label>Title</label>
<input type="text" name="" value="">
<label>Description</label><br>
<textarea name="" rows="5" column="5"></textarea>
</div>
</div>
<?php
}
}
但在填充文本框后,它不会触发发布按钮。数据未保存在数据库中。我不明白如何将这些数据保存到数据库中。谁能面对这个问题
$wp_customize->add_setting( 'koble_kus_hero_section_content', array(
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new Koble_Kus_Custom_Stack_Input_Customizer( $wp_customize, 'koble_kus_hero_section_content', array(
'label' => 'Hero section content',
'description' => '',
'section' => 'koble_kus_header_section',
) ) );