Action Dynamic uncanny-automator

automator_settings_advanced_{dynamic}_tab

> **Note:** This is a dynamic hook. The actual hook name is constructed at runtime. Fires when the advanced tab settings for a specific dynamic integration are displayed on the settings page.

add_action( 'automator_settings_advanced_{dynamic}_tab', $callback, 10, 1 );

Description

Fires after the tab content for an advanced settings tab has been generated, allowing developers to add custom content or logic to specific advanced settings tabs. The `dynamic` part of the hook name will be replaced by the actual tab key (e.g., `automator_settings_advanced_general_tab`). This hook is useful for extending the functionality of advanced settings with custom integrations or features.


Usage

add_action( 'automator_settings_advanced_{dynamic}_tab', 'your_function_name', 10, 1 );

Examples

// Example: Add a custom section to the 'Integrations' advanced tab in Automator settings.
// This hook fires within a specific advanced tab's content area.

add_action( 'automator_settings_advanced_integrations_tab', 'my_automator_add_custom_integration_settings', 10, 0 );

/**
 * Adds a custom settings section to the 'Integrations' advanced tab.
 *
 * This function is called when the 'automator_settings_advanced_integrations_tab' action hook is triggered.
 * It demonstrates how to add custom HTML content, such as a new setting field or information,
 * within a specific advanced settings tab.
 */
function my_automator_add_custom_integration_settings() {
	// In a real scenario, you might fetch options, register settings, or display specific information.
	// For this example, we'll just add a simple descriptive text.

	?>
	<div class="uo-setting-field uo-setting-field--wysiwyg">
		<div class="uo-setting-field__label">
			<label for="my_custom_integration_api_key">Custom Integration API Key</label>
		</div>
		<div class="uo-setting-field__input">
			<input type="text"
				   id="my_custom_integration_api_key"
				   name="my_custom_integration_settings[api_key]"
				   value="<?php echo esc_attr( get_option( 'my_custom_integration_api_key', '' ) ); ?>"
				   placeholder="Enter your custom integration API key">
			<p class="uo-setting-field__description">
				Get your API key from your custom integration provider's dashboard.
			</p>
		</div>
	</div>
	<?php
}

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-settings/tab/advanced.php:67

?>

			<uo-tab-panel id="<?php echo esc_attr( $tab_key ); ?>"

				<?php echo $advanced_tab->is_selected ? 'active' : ''; ?>
			><!--uo-tab-panel />-->

				<?php do_action( 'automator_settings_advanced_' . $tab_key . '_tab' ); ?>

			</uo-tab-panel>

			<?php

		}
	}

Scroll to Top