function wcps_metabox_navs_20200516($team_settings_tab) { $current_tab = isset($_POST['tab']) ? $_POST['tab'] : 'general'; $team_settings_tab[] = array( 'id' => 'custom', 'title' => sprintf(__('%s Custom','text-domain'),'<i class="fas fa-list-ul"></i>'), 'priority' => 3, 'active' => ($current_tab == 'custom') ? true : false, ); return $team_settings_tab; } add_filter('wcps_metabox_navs', 'wcps_metabox_navs_20200516', 99);
Display nav content
add_action('wcps_metabox_content_custom', 'wcps_metabox_content_custom'); function wcps_metabox_content_custom(){ $settings_tabs_field = new settings_tabs_field(); $team_settings = get_option('team_settings'); $custom_option = isset($team_settings['custom_option']) ? $team_settings['custom_option'] : ''; ?> <div class="section"> <div class="section-title"><?php echo __('Custom Tab', 'text-domain'); ?></div> <p class="description section-description"><?php echo __('Custom tab description.', 'text-domain'); ?></p> <?php $args = array( 'id' => 'custom_option', 'parent' => 'team_settings', 'title' => __('custom option','text-domain'), 'details' => __('Write custom option details.','text-domain'), 'type' => 'text', 'value' => $custom_option, 'default' => '', 'placeholder' => 'Custom text here', ); $settings_tabs_field->generate_field($args); ?> </div> <?php }