“我自己的可切换”标签中的“ Woocommerce管理字段”,其中包含“设置”标签

时间:2019-07-03 10:12:19

标签: wordpress woocommerce

因此,我一直在使用Woocommerce插件,到目前为止,我已经在Woocommerce设置页面中创建了设置选项卡,创建了Toggleable选项卡,但是我想在其中一个可切换选项卡中添加woocommerce_admin_fields(),但是每当我将其添加到选项卡顶部。

这是我得到的结果的屏幕截图 Screen shot of the result

所以我不知道该怎么做

public static function get_settings() {
    // $args = array(
    //  "fgwp_settings" => self::$settings,
    // );
    $settings = array(
        'section_title' => array(
            'name'     => __( 'Section Title', 'woocommerce-settings-tab-demo' ),
            'type'     => 'title',
            'desc'     => '',
            'id'       => 'wc_product-filter_section_title'
        ),
        'title' => array(
            'name' => __( 'Title', 'woocommerce-settings-tab-demo' ),
            'type' => 'select',
            'class' => 'chosen_select',
            'css' => 'min-width:300px;',
            'options' => array(
                0 => __('No', 'woocommerce-products-filter'),
                1 => __('Yes', 'woocommerce-products-filter')
            ),
            'desc_tip' => true,
            'desc' => __('Select "Yes" if you want to TRY make filtering in your shop by AJAX. Not compatible for 100% of all wp themes, so test it well if you are going to buy premium version of the plugin because incompatibility is not fixable!', 'woocommerce-products-filter'),                            
                            'id'   => 'wc_product-filter_title',
        ),
        'description' => array(
            'name' => __( 'Description', 'woocommerce-settings-tab-demo' ),
            'type' => 'textarea',
            'desc' => __('Select "Yes" if you want to TRY make filtering in your shop by AJAX. Not compatible for 100% of all wp themes, so test it well if you are going to buy premium version of the plugin because incompatibility is not fixable!', 'woocommerce-products-filter'),
            'id'   => 'wc_product-filter_description'
        ),
        'section_end' => array(
            'type' => 'sectionend',
            'id' => 'wc_product-filter_section_end'
        )
    );
    return apply_filters( 'wc_product-filter_settings', $settings );
}


public static function settings_tab() {
    include( woocommerce_admin_fields( self::get_settings() ));
    return ;
}




// Now to retrive the all fields I created tab and add this
//This is how I'm retriving the fields

self::settings_tab()

0 个答案:

没有答案