Filter uncanny-automator

automator_tools_header_tabs

Filters the available header tabs for the Uncanny Automator Tools menu.

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

Description

Fires in the Uncanny Automator admin tools header to filter available tabs. Developers can add, remove, or modify tabs displayed in the tools section, such as status, logs, or database tools. This filter allows for custom integration and extension of the admin interface.


Usage

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

Return Value

The filtered value.


Examples

<?php
/**
 * Example of adding a custom tab to the Uncanny Automator Tools header.
 *
 * This function adds a new tab labeled "Custom Tools" to the Uncanny Automator
 * Tools admin page.
 */
add_filter( 'automator_tools_header_tabs', 'my_custom_automator_tools_tab', 10, 1 );

/**
 * Adds a custom tab to the Uncanny Automator Tools header.
 *
 * @param array $tabs An array of existing tabs.
 * @return array The modified array of tabs including the new custom tab.
 */
function my_custom_automator_tools_tab( $tabs ) {
	// Add a new tab with a unique key and a translatable label.
	$tabs['uncanny-automator-my-custom-tab'] = esc_html__( 'Custom Tools', 'my-text-domain' );

	// You can also remove existing tabs if needed, for example:
	// unset( $tabs['uncanny-automator-database-tools'] );

	// You could also reorder tabs by manipulating the array keys and values.

	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/views/admin-tools-header.php:2

<?php
$available_tabs = apply_filters(
	'automator_tools_header_tabs',
	array(
		'uncanny-automator-tools'          => esc_html__( 'Status', 'uncanny-automator' ),
		'uncanny-automator-debug-log'      => esc_html__( 'Logs', 'uncanny-automator' ),
		'uncanny-automator-database-tools' => esc_html__( 'Database tools', 'uncanny-automator' ),
	)
);


Scroll to Top