Filter uncanny-automator

automator_after_settings_extra_content

Filters the extra content displayed after the main settings section on the AutomatorWP settings page.

add_filter( 'automator_after_settings_extra_content', $callback, 10, 3 );

Description

Fires after the main settings content is displayed within the Automator settings pages. Developers can use this filter to add custom content, modify existing elements, or inject additional controls. It receives the current extra content, the active status of the item, and the current tab name.


Usage

add_filter( 'automator_after_settings_extra_content', 'your_function_name', 10, 3 );

Parameters

$extra_content (mixed)
This parameter holds the HTML content that will be displayed after the main settings form.
$active (mixed)
This parameter contains any additional HTML content that can be injected after the main settings section.
$tab (mixed)
This parameter indicates whether the current settings tab is active.

Return Value

The filtered value.


Examples

<?php
/**
 * Example of using the 'automator_after_settings_extra_content' filter hook.
 * This example adds a custom notice to the settings page if a specific tab is active
 * and a certain condition related to the active status is met.
 *
 * @param mixed $extra_content The existing extra content for the settings page.
 * @param mixed $active        The currently active setting group.
 * @param mixed $tab           The currently active tab within the settings group.
 *
 * @return mixed The modified extra content.
 */
function my_automator_custom_settings_notice( $extra_content, $active, $tab ) {

	// Check if we are on a specific tab and if the active status indicates something.
	// For example, let's say we want to show a notice on the 'integrations' tab
	// only when integrations are *not* active, to encourage setup.
	if ( 'integrations' === $tab && false === $active ) {

		// Construct the notice HTML.
		$custom_notice = '<div class="notice notice-info is-dismissible">';
		$custom_notice .= '<p><strong>Important:</strong> You have not configured any integrations yet. Click here to get started!</p>';
		$custom_notice .= '<p><a href="' . esc_url( admin_url( 'admin.php?page=automator&tab=integrations' ) ) . '">Set up Integrations</a></p>';
		$custom_notice .= '</div>';

		// Append our custom notice to the existing extra content.
		$extra_content .= $custom_notice;
	}

	// Always return the modified or original $extra_content.
	return $extra_content;
}

// Add the filter to WordPress.
// The third parameter '3' specifies that our callback function accepts 3 arguments:
// $extra_content, $active, and $tab.
add_filter( 'automator_after_settings_extra_content', 'my_automator_custom_settings_notice', 10, 3 );
?>

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:130
src/core/includes/automator-settings.php:288

'',
										$active,
										$tab,
									),
									'3.0',
									'automator_after_settings_extra_content'
								);
								$extra_content = apply_filters( 'automator_after_settings_extra_content', $extra_content, $active, $tab );
								ob_start();
								echo $extra_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
								echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
								?>
							</div>
						</div>
						<div class="uo-settings-content-footer">


Scroll to Top