Action
uncanny-automator
automator_after_settings
Fires after automator settings have been saved.
add_action( 'automator_after_settings', $callback, 10, 1 );
Description
Fires after the main Automator settings are displayed. Developers can use this hook to add custom content, buttons, or integrations to the Automator settings page. This hook is intended for extending the core functionality of the Automator settings interface.
Usage
add_action( 'automator_after_settings', 'your_function_name', 10, 1 );
Examples
add_action( 'automator_after_settings', 'my_custom_automator_settings_extension', 10, 0 );
/**
* Adds custom fields or information after the Automator plugin's settings form.
* This function is hooked into the 'automator_after_settings' action.
*
* @since 1.0.0
*/
function my_custom_automator_settings_extension() {
// Example: Add a simple notification message indicating the settings were processed.
// In a real-world scenario, you might:
// - Check user capabilities before displaying anything.
// - Fetch and display custom options related to Automator.
// - Output a button to trigger a specific Automator-related task.
if ( current_user_can( 'manage_options' ) ) {
?>
<div class="notice notice-info">
<p>Your custom content for Automator settings has been loaded.</p>
</div>
<?php
}
// Example: Fetch and display some additional data from a custom meta field associated with Automator.
// Let's assume there's a general setting stored somewhere that we want to display.
$automator_custom_data = get_option( 'my_plugin_automator_extra_data', '' );
if ( ! empty( $automator_custom_data ) ) {
?>
<div class="automator-extra-settings-display">
<h3>Additional Automator Data:</h3>
<p><?php echo esc_html( $automator_custom_data ); ?></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/includes/automator-settings.php:167
src/core/includes/automator-settings.php:325
ob_start();
echo $extra_buttons; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
<?php
do_action_deprecated( 'uap_after_automator_settings', array(), '3.0', 'automator_after_settings' );
do_action( 'automator_after_settings' );
}
?>
</form>
<?php
do_action_deprecated( 'uap_after_automator_settings_form', array(), '3.0', 'automator_after_settings_form' );
do_action( 'automator_after_settings_form' );
?>