WOOT - WooCommerce Active Products Tables

Cyber Monday 2021
Cyber Monday 2021 timer

woot_extend_settings

This hook allows to add custom settings to the tables

Example:

add_action('woot_extend_settings', function($rows) {
            $rows[] = [
                'id' => 0,
                'title' => esc_html__('Hide shop cart button', 'woot-products-tables'),
                'value' => WOOT_HELPER::draw_switcher('hide_shop_cart_btn', WOOT_Settings::get('hide_shop_cart_btn'), 0, 'woot_save_settings_field'),
                'notes' => esc_html__('Hide shop cart button on WOOT Cart panel', 'woot-products-tables')
            ];

            $rows[] = [
                'id' => 0,
                'title' => esc_html__('Hide checkout button', 'woot-products-tables'),
                'value' => WOOT_HELPER::draw_switcher('hide_checkout_btn', WOOT_Settings::get('hide_checkout_btn'), 0, 'woot_save_settings_field'),
                'notes' => esc_html__('Hide checkout button on WOOT Cart panel', 'woot-products-tables')
            ];

            //+++

            $selected = explode(',', WOOT_Settings::get($this->setting_key));
            $options = [];

            foreach (apply_filters(WOOT_WooCommerce::$action, 0, []) as $key => $value) {
                if (isset($value['title'])) {
                    $options[$key] = $value['title'];
                }
            }

            $rows[] = [
                'id' => 0,
                'title' => esc_html__('Shop cart columns', 'woot-products-tables'),
                'value' => [
                    'value' => WOOT_HELPER::draw_select([
                        'class' => 'woot-multiple-select',
                        'multiple' => '',
                        'data-action' => 'woot_save_settings_field',
                        'data-values' => WOOT_Settings::get($this->setting_key)
                            ], $options, $selected),
                    'custom_field_key' => $this->setting_key
                ],
                'notes' => sprintf(esc_html__('Columns of WOOT shop cart. Press and wait to reorder.', 'woot-products-tables'), $this->default_columns)
            ];

            return $rows;
        }, 10, 1);

 

Also read: woot_extend_settings_default