Filter
uncanny-automator
automator_wpforms_pro_only_fields
Filters the list of WPForms Pro-only fields available for automation.
add_filter( 'automator_wpforms_pro_only_fields', $callback, 10, 1 );
Description
Filters the list of WPForms field types considered "pro only" for use in AutomatorWP. Developers can modify this array to include or exclude specific pro fields, allowing for custom behavior in integrations where field type matters. This hook fires when AutomatorWP checks if a WPForms field requires a Pro license.
Usage
add_filter( 'automator_wpforms_pro_only_fields', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
/**
* Example: Remove the 'signature' field from the list of WPForms Pro-only fields.
*
* This filter allows developers to modify the array of field types that are
* considered "Pro only" by the Automator plugin when processing WPForms.
*
* @param array $pro_only_fields An array of WPForms field types considered Pro only.
* @return array The modified array of Pro-only fields.
*/
add_filter( 'automator_wpforms_pro_only_fields', 'my_custom_wpforms_pro_fields', 10, 1 );
function my_custom_wpforms_pro_fields( $pro_only_fields ) {
// Remove the 'signature' field from the Pro-only list.
if ( ( $key = array_search( 'signature', $pro_only_fields, true ) ) !== false ) {
unset( $pro_only_fields[ $key ] );
}
// Optionally, add a custom field type as Pro-only if needed.
// $pro_only_fields[] = 'my_custom_pro_field';
return $pro_only_fields;
}
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/integrations/wpforms/tokens/wpf-tokens.php:880
private function is_pro_field( $field_type ) {
// REVIEW - Would be nice to grab these from a function.
$pro_only = apply_filters(
'automator_wpforms_pro_only_fields',
array(
'phone',
'address',
'date-time',
'url',
'file-upload',
'password',
'richtext',
'layout',
'pagebreak',
'divider',
'html',
'content',
'rating',
'hidden',
'captcha',
'signature',
'likert_scale',
'net_promoter_score',
'paypal-commerce',
'square',
'authorize_net',
)
);
return in_array( $field_type, $pro_only, true );
}