Filter uncanny-automator

automator_settings_uncanny_agent_tabs

Filters the tabs displayed within the Uncanny Automator settings for Agent integrations.

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

Description

Filters the array of tabs displayed on the Uncanny Agent settings page. Developers can use this hook to add, remove, or modify tabs programmatically, enabling custom integrations or UI adjustments. The hook fires before the tabs are rendered in the admin settings.


Usage

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

Return Value

The filtered value.


Examples

add_filter(
	'automator_settings_uncanny_agent_tabs',
	function ( $tabs ) {
		// Add a new custom tab for Uncanny Agent settings.
		// This example assumes you have a custom feature that needs its own settings section.
		$tabs['my_custom_agent_tab'] = array(
			'label' => __( 'My Custom Settings', 'uncanny-automator-custom' ),
			'link'  => '#my_custom_agent_tab', // This would typically link to a specific section on the page
		);

		// You could also conditionally modify existing tabs if needed.
		// For instance, if a specific plugin is active, you might want to add a warning to a tab.
		if ( defined( 'SOME_OTHER_PLUGIN_ACTIVE' ) ) {
			// Example: add a warning to the default tab
			// This requires knowing the key of the default tab, which might be 'general' or similar.
			// For this example, let's assume a 'general' tab exists.
			if ( isset( $tabs['general'] ) ) {
				$tabs['general']['label'] .= ' <span class="dashicons dashicons-warning" style="color:red;"></span>';
			}
		}

		return $tabs;
	},
	10,
	1
);

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/uncanny-agent.php:108

public function get_uncanny_agent_tabs() {

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

Scroll to Top