Filter uncanny-automator

automator_settings_advanced_tabs

Filters advanced settings tabs to allow adding or modifying them within the Automator settings.

add_filter( 'automator_settings_advanced_tabs', $callback, 10, 1 );

Description

This filter allows developers to programmatically add or modify tabs displayed within the advanced settings section of the Automator plugin. Developers can return a modified array of tab configurations, enabling custom integrations or extending existing functionality. Use this hook to introduce new settings pages or customize the order and visibility of existing advanced tabs.


Usage

add_filter( 'automator_settings_advanced_tabs', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

add_filter( 'automator_settings_advanced_tabs', 'my_custom_automator_advanced_tabs', 10, 1 );

/**
 * Adds a custom advanced tab to the Automator settings.
 *
 * @param array $tabs An array of existing advanced tabs.
 * @return array The modified array of advanced tabs.
 */
function my_custom_automator_advanced_tabs( $tabs ) {
	// Let's say we want to add a tab for "API Integrations"
	$custom_tab_id    = 'api_integrations';
	$custom_tab_label = __( 'API Integrations', 'my-text-domain' );
	$custom_tab_view  = trailingslashit( MY_PLUGIN_PATH ) . 'admin/views/api-integrations-settings.php';

	// Add our new tab to the existing array.
	// The key is the unique ID of the tab, and the value is an array
	// containing the label and the path to the view file.
	$tabs[ $custom_tab_id ] = array(
		'label' => $custom_tab_label,
		'view'  => $custom_tab_view,
	);

	return $tabs;
}

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/core/admin/admin-settings/tabs/advanced.php:107

public function get_advanced_tabs() {

		return apply_filters( 'automator_settings_advanced_tabs', array() );
	}

Internal Usage

Found in src/core/admin/admin-settings/tabs/advanced-tabs/background-actions.php:22:

add_filter( 'automator_settings_advanced_tabs', array( $this, 'create_tab' ), 99, 1 );

Found in src/core/admin/admin-settings/tabs/advanced-tabs/automator-cache.php:25:

add_filter( 'automator_settings_advanced_tabs', array( $this, 'create_tab' ), 99, 1 );
Scroll to Top