Display tabs
add_filter('breadcrumb_settings_tabs', 'breadcrumb_settings_tabs_20200203'); function breadcrumb_settings_tabs_20200203($settings_tabs){ $current_tab = isset($_POST['tab']) ? $_POST['tab'] : 'options'; $settings_tabs[] = array( 'id' => 'custom_atb', 'title' => sprintf(__('%s Custom','breadcrumb'),'<i class="fas fa-star-of-life"></i>'), 'priority' => 99, 'active' => ($current_tab == 'custom_atb') ? true : false, ); return $settings_tabs; }
Display tab content
add_action('breadcrumb_settings_tabs_content_custom_tab','breadcrumb_settings_tabs_content_custom_tab'); function breadcrumb_settings_tabs_content_custom_tab(){ $settings_tabs_field = new settings_tabs_field(); $custom_option = get_option('custom_option'); ?> <div class="section"> <div class="section-title"><?php echo __('Custom tab settings','breadcrumb'); ?></div> <p class="description section-description"><?php echo __('This is custom tab descriptions.','breadcrumb'); ?></p> <?php $args = array( 'id' => 'custom_option', //'parent' => 'breadcrumb_options', 'title' => __('Breadcrumb custom option','breadcrumb'), 'details' => __('Custom option descriptions','breadcrumb'), 'type' => 'text', 'value' => $custom_option, 'default' => '', ); $settings_tabs_field->generate_field($args); ?> </div> <?php }
Save options
add_action('breadcrumb_settings_save', 'breadcrumb_settings_save_20200203'); if(!function_exists('breadcrumb_settings_save_20200203')) { function breadcrumb_settings_save(){ $custom_option = sanitize_text_field($_POST['custom_option']); update_option('custom_option', $custom_option); } }