Action uncanny-automator

automator_app_settings_{$id}_after_{$status}_panel_bottom

Fires after the bottom of a specific app settings panel for a given status has been rendered.

add_action( 'automator_app_settings_{$id}_after_{$status}_panel_bottom', $callback, 10, 1 );

Description

Fires after the bottom sections of an app's settings panel are rendered for a specific app ID and status. Developers can use this hook to add custom content or functionality below the default bottom panel elements, allowing for expanded integration options within the app's settings interface.


Usage

add_action( 'automator_app_settings_{$id}_after_{$status}_panel_bottom', 'your_function_name', 10, 1 );

Parameters

$this (mixed)
This parameter contains the current object instance of the settings panel, which is used to access its properties and methods within the hook.

Examples

<?php
/**
 * Add a custom notice to the bottom of the settings panel for specific app statuses.
 *
 * This function hooks into the 'automator_app_settings_{$id}_after_{$status}_panel_bottom'
 * action hook. It checks if the current app status is 'active' and then outputs a
 * custom HTML notice.
 *
 * @param object $app_object The main app object passed from the hook.
 */
add_action(
	'automator_app_settings_my_custom_app_id_after_active_panel_bottom',
	function( $app_object ) {
		// This example assumes $app_object has a property like 'status'
		// and that the hook is already specific enough for the status.
		// However, if the hook was more generic, you might add a check here:
		// if ( ! isset( $app_object->status ) || 'active' !== $app_object->status ) {
		//     return;
		// }

		// Output a custom informational notice.
		echo '<div class="uap-notice uap-notice-info" style="margin-top: 20px;">';
		echo '<strong>Important:</strong> This app is currently active. Any changes made here will take effect immediately.';
		echo '</div>';
	},
	10, // Priority: 10 is the default.
	1  // Accepted args: Only the $app_object is expected.
);

// Example for a different status.
add_action(
	'automator_app_settings_another_app_id_after_draft_panel_bottom',
	function( $app_object ) {
		echo '<div class="uap-notice uap-notice-warning" style="margin-top: 20px;">';
		echo '<strong>Draft Mode:</strong> This app is in draft mode. It will not trigger until published.';
		echo '</div>';
	},
	10,
	1
);
?>

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/lib/settings/trait-premium-integration-templating.php:193

public function output_panel_bottom() {
		// Dynamic hook status key.
		$status = $this->get_hook_status_key();
		$id     = $this->get_id();

		// Hook before bottom panel output.
		do_action( "automator_app_settings_{$id}_before_{$status}_panel_bottom", $this );
		?>
		<div class="uap-settings-panel-bottom-left">
			<?php $this->output_panel_bottom_left(); ?>
		</div>
		<div class="uap-settings-panel-bottom-right">
			<?php $this->output_panel_bottom_right(); ?>
		</div>
		<?php
		// Hook after bottom panel output.
		do_action( "automator_app_settings_{$id}_after_{$status}_panel_bottom", $this );
	}


Scroll to Top