Action
Dynamic
uncanny-automator
automator_settings_premium_integrations_{dynamic}_tab
> **Note:** This is a dynamic hook. The actual hook name is constructed at runtime. Fires when displaying a specific premium integration's tab within Automator settings.
add_action( 'automator_settings_premium_integrations_{dynamic}_tab', $callback, 10, 1 );
Description
Fires within a specific premium integration tab on the Automator settings page. Developers can hook into this dynamic action to inject custom content or functionality directly into the tab's content area before it's rendered. This allows for fine-grained control over the display of integration-specific settings or information.
Usage
add_action( 'automator_settings_premium_integrations_{dynamic}_tab', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Example of adding content to a specific premium integration tab.
* This function will display a small notice within the "Stripe" integration tab
* on the Automator plugin's settings page.
*/
add_action( 'automator_settings_premium_integrations_stripe_tab', 'my_automator_stripe_tab_content', 10, 0 );
function my_automator_stripe_tab_content() {
// Check if the current user has sufficient permissions to see this content.
if ( current_user_can( 'manage_options' ) ) {
?>
<div class="uo-notice uo-notice--info">
<p><?php esc_html_e( 'Here you can manage your Stripe integration settings. Remember to check the documentation for best practices.', 'your-text-domain' ); ?></p>
</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/premium-integrations.php:144
// IF the tab is selected, then add the "active" attribute
echo $integration_tab->is_selected ? 'active' : '';
?>
>
<?php do_action( 'automator_settings_premium_integrations_' . $tab_key . '_tab' ); ?>
</uo-tab-panel>
<?php
}
}