✏️ 正在编辑: form-select.php
路径:
/home/ubuntu/plugins-bkp-26012025/styler-for-wpforms/includes/form-select.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * Control to select the form in customizer. */ $wp_customize->add_section( 'sfwf_select_form_section', array( 'title' => 'Select WPForm', 'panel' => 'sfwf_panel', ) ); $wp_customize->add_setting( 'sfwf_select_form_id', array( 'default' => '-1', 'transport' => 'postMessage', 'type' => 'option', ) ); // get all WPForms forms created by user. if ( function_exists( 'wpforms' ) || class_exists( 'WPForms' ) ) { $wpforms_hander = wpforms()->form; $forms = $wpforms_hander->get(); $select_form = array( -1 => '---Select form --' ); if ( $forms ) { foreach ( $forms as $form ) { $select_form[ $form->ID ] = $form->post_title; } } } else { $select_form['form not installed'] = 'WPForms not installed'; } $wp_customize->add_control( 'sfwf_select_form_id', array( 'type' => 'select', 'priority' => 10, // Within the section. 'section' => 'sfwf_select_form_section', // Required, core or custom. 'label' => __( 'Select WPForm' ), 'choices' => $select_form, ) );
💾 保存文件
← 返回文件管理器