Action uncanny-automator

automator_app_settings_{$id}_after_{$status}_panel_bottom_left

Fires after the panel's bottom left section in a specific app settings page, post-status update.

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

Description

Fires after the bottom left content of an integration's settings panel is rendered, specifically after connection status is determined and displayed. Developers can use this action to add custom content or functionality to this area, such as extra status indicators or contextual links, based on the integration ID and its connection status.


Usage

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

Parameters

$this (mixed)
This parameter is a reference to the current object instance within the class.

Examples

add_action( 'automator_app_settings_my_integration_after_connected_panel_bottom_left', 'my_custom_automator_app_settings_bottom_left_content', 10, 1 );

/**
 * Adds custom content to the bottom left of the Automator App settings panel
 * after the default connected content has been displayed, for a specific integration.
 *
 * @param mixed $app_object The Automator App object instance, passed by the hook.
 */
function my_custom_automator_app_settings_bottom_left_content( $app_object ) {
	// Check if the passed object is indeed an Automator App object and if it has the expected method
	if ( ! is_object( $app_object ) || ! method_exists( $app_object, 'get_some_custom_setting' ) ) {
		return;
	}

	// Retrieve a custom setting specific to this integration
	$custom_setting_value = $app_object->get_some_custom_setting();

	// Display a custom message based on the retrieved setting
	if ( ! empty( $custom_setting_value ) ) {
		echo '<div class="automator-custom-info">';
		echo '<p><strong>Custom Information:</strong> Your special setting is currently set to: ' . esc_html( $custom_setting_value ) . '</p>';
		echo '</div>';
	} else {
		echo '<div class="automator-custom-info">';
		echo '<p><em>No custom information is available at this time.</em></p>';
		echo '</div>';
	}
}

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:217

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

		// Hook before bottom left content based on integration and connection status.
		do_action( "automator_app_settings_{$id}_before_{$status}_panel_bottom_left", $this );

		// Output bottom left content based on connection status
		if ( $this->is_connected ) {
			$this->output_bottom_left_connected_content();
		} else {
			$this->output_bottom_left_disconnected_content();
		}

		// Hook after bottom left content based on integration and connection status.
		do_action( "automator_app_settings_{$id}_after_{$status}_panel_bottom_left", $this );
	}


Scroll to Top