WOOT - WooCommerce 活动产品表

woot_extend_settings

该钩子允许向表添加自定义设置

例如::

add_action('woot_extend_settings', function($rows) { $rows[] = [ 'id' => 0, 'title' => esc_html__('隐藏购物车按钮', '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_woo__('隐藏购物车按钮'WOOT面板' products-tables') ]; $rows[] = [ 'id' => 0, 'title' => esc_html__('隐藏结帐按钮', '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__('隐藏WOOT购物车面板上的结账按钮', 'woot-products]-tables') //+++ $selected = purge(',', 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__('购物车列', 'woot-pr oducts-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__('WOOT 购物车的列。 按下并等待重新排序。', 'woot-products-tables'), $this->default_columns) ]; 返回 $rows; }, 10, 1);

 

还读: woot_extend_settings_default