Поля администратора Woocommerce на моей собственной вкладке с переключателем на вкладке Настройка - PullRequest
0 голосов
/ 03 июля 2019

Итак, я работал над своим плагином Woocommerce, поэтому я создал вкладки настроек на странице настроек Woocommerce, в которой я создал вкладку Toggleable, но я хотел добавить woocommerce_admin_fields () в одну из переключаемых вкладок, но всякий раз, когда я сделать это добавлено вверху вкладки.

Это скриншот результата, который я получаю Снимок экрана с результатом

Так что я не знаю, как это сделать

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()
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...