Filter uncanny-automator-pro

automator_pro_get_webhook_route_prefix

Filters the webhook route prefix for Automator Pro, allowing customization of the base URL for webhook endpoints.

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

Description

Fires when Uncanny Automator Pro retrieves the base prefix for its webhook routes. Developers can modify this prefix to customize webhook endpoint URLs. The default prefix is 'uap'.


Usage

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

Return Value

The filtered value.


Examples

/**
 * Change the webhook route prefix to a more descriptive slug.
 *
 * This example demonstrates how to modify the default 'uap' prefix
 * to something more specific, like 'uncanny-automator-webhooks'.
 * This can help in organizing and identifying webhook traffic.
 */
add_filter( 'automator_pro_get_webhook_route_prefix', 'my_custom_webhook_prefix', 10, 1 );
function my_custom_webhook_prefix( $prefix ) {
    // Check if the current prefix is the default 'uap' and if it's not already changed.
    if ( 'uap' === $prefix ) {
        return 'uncanny-automator-webhooks';
    }
    // If it's already been modified by another plugin or function, keep the existing prefix.
    return $prefix;
}

/**
 * Only identify and add tokens IF it's edit recipe page
 * @return bool
 */
function automator_pro_do_identify_tokens() {

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/global-functions.php:11

function automator_pro_get_webhook_route_prefix() {
	return apply_filters( 'automator_pro_get_webhook_route_prefix', 'uap' );
}

Scroll to Top