Action
uncanny-automator
automator_settings_header_after
Fires after the main header on the Automator settings page, allowing for custom additions.
add_action( 'automator_settings_header_after', $callback, 10, 1 );
Description
Fires after the main settings header is rendered in the WordPress admin. Developers can use this hook to add custom content, meta boxes, or any other elements directly below the main "Settings" title, before the tabbed content begins. This is an ideal spot for adding important notices or external links related to settings.
Usage
add_action( 'automator_settings_header_after', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Add a custom notification message after the settings header.
*
* This function is hooked into 'automator_settings_header_after' to display
* a helpful message to users when they first access the Uncanny Automator settings page,
* encouraging them to explore the available features.
*/
function uncanny_automator_display_welcome_message_on_settings() {
// Check if the current user can manage options, to avoid displaying to users who can't access settings.
if ( current_user_can( 'manage_options' ) ) {
?>
<div class="notice notice-info is-dismissible">
<p>
<?php
printf(
/* translators: %s: Link to Uncanny Automator documentation. */
__( 'Welcome to Uncanny Automator settings! Explore the possibilities to automate your WordPress site. For more information, please visit our %s.', 'uncanny-automator' ),
'<a href="https://www.uncannyautomator.com/documentation/" target="_blank">' . __( 'documentation', 'uncanny-automator' ) . '</a>'
);
?>
</p>
</div>
<?php
}
}
// Add the action to the 'automator_settings_header_after' hook.
// We use priority 10 (default) and accept 0 arguments as the hook itself doesn't pass any parameters.
add_action( 'automator_settings_header_after', 'uncanny_automator_display_welcome_message_on_settings', 10, 0 );
?>
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/admin-settings.php:38
<?php esc_html_e( 'Settings', 'uncanny-automator' ); ?>
</div>
</div>
<?php
}
do_action( 'automator_settings_header_after' );
?>
<div id="uap-settings-content" class="uap-settings-content">
<uo-tabs
tab="settings"