This hook allows to extend tables settings.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | add_filter('tableon_extend_options', 'my_tableon_extend_options', 10, 2); public function my_tableon_extend_options($rows, $table_id) { if ($table_id > 0) { if (TABLEON::get_table_action($table_id) === self::$action) { $rows[] = [ 'id' => $table_id, 'title' => esc_html__('Show Sorting Dropdown', 'posts-table'), 'value' => TABLEON_HELPER::draw_switcher('is_sort_droptdown_shown', tableon()->columns->options->get($table_id, 'is_sort_droptdown_shown', 0), $table_id, 'tableon_save_table_option'), 'value_custom_field_key' => 'is_sort_droptdown_shown', 'notes' => esc_html__('Displays Sorting Dropdown list', 'posts-table') ]; $rows[] = [ 'id' => $table_id, 'title' => esc_html__('Sorting Dropdown Fields', 'posts-table'), 'value' => TABLEON_HELPER::draw_select([ 'class' => 'tableon-multiple-select', 'multiple' => '', 'data-action' => 'tableon_save_table_option', 'data-values' => tableon()->columns->options->get($table_id, 'orderby_select_fields', ''), 'data-use-drag' => 1, ], apply_filters('tableon_table_orderby_select_args', self::$orderby_select_fields, $table_id), explode(',', tableon()->columns->options->get($table_id, 'orderby_select_fields', ''))), 'value_custom_field_key' => 'orderby_select_fields', 'notes' => esc_html__('fields which you want to see in Sorting Dropdown fields. Press and wait to reorder.', 'posts-table') ]; $rows[] = [ 'id' => $table_id, 'title' => esc_html__('Sorting Dropdown position', 'posts-table'), 'value' => TABLEON_HELPER::draw_select([ 'data-action' => 'tableon_save_table_option', ], [ 'right' => esc_html__('Right', 'posts-table'), 'left' => esc_html__('Left', 'posts-table'), ], tableon()->columns->options->get($table_id, 'sorting_position', 'right')), 'value_custom_field_key' => 'sorting_position', 'notes' => esc_html__('Sorting Dropdown position.', 'posts-table') ]; } } return $rows; } |
See also file: \classes\tables-options.php