Filter uncanny-automator-pro

automator_pro_incoming_webhook_content_types

Filters the allowed content types for incoming webhooks before they are processed.

add_filter( 'automator_pro_incoming_webhook_content_types', $callback, 10, 1 );

Description

Allow developers to modify the available content types for incoming webhooks. This filter applies to the data format selection within Uncanny Automator Pro's webhook trigger, enabling customization of supported formats beyond the default options.


Usage

add_filter( 'automator_pro_incoming_webhook_content_types', 'your_function_name', 10, 1 );

Parameters

$formats (mixed)
This parameter contains an array of available data formats for incoming webhooks.

Return Value

The filtered value.


Examples

// Add a custom content type option for incoming webhooks.
add_filter(
	'automator_pro_incoming_webhook_content_types',
	function ( $formats ) {
		// Add a new format for XML content.
		$formats['xml'] = __( 'XML', 'uncanny-automator-pro' );
		return $formats;
	},
	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

uncanny-automator-pro/src/core/webhook/webhook-common-options.php:166

$webhook_fields[] = array(
				'input_type'    => 'select',
				'option_code'   => 'DATA_FORMAT',
				'label'         => $options['format_label'],
				'description'   => $options['format_description'],
				'required'      => true,
				'default_value' => 'auto',
				'options'       => apply_filters(
					'automator_pro_incoming_webhook_content_types',
					$formats
				),
			);
		}
		// Header ( Security headers ).
		if ( $options['headers'] ) {

Scroll to Top