sts-settings-content

/**
* Filter the settings tabs
*
* @param     (array)     the current tabs
* @return     (array)     the altered tabs
**/

If you want to alter the sections (e.g. a new tab) in the plugins settings, you can use this filter.

You receive the tab array. A single tab consists out of four parameters:

  • id – the ID of the tab.
  • title – the title of the tab.
  • before_form – the HTML before the metaboxes.
  • after_form – the HTML after the metaboxes.

For each tab you can register metaboxes seperatly. Out of the tab ID the necessary $screen for add_meta_box() will be generated. The $screen will be ticket-settings-{$sectionid}.

The tab ID is also used to perform the update filter: sts-settings-update-{$sectionid}

Exampel: Add a new tab

add_filter( 'sts-settings-content’, 'new_tab’ );
function new_tab( $sts_setting_content ){
$sts_setting_content[] = array(
'id’ => 'new-tab’,
'title’ => 'New Tab’,
'before_form’ => 'This is a new tab’ ,
'after_form’ => ”,
);
return $sts_setting_content;
}