Hey,
Just wondering if it would be possible to automatically trigger the custom action hook instead of having to select it as an action in each form.
I’m thinking about if someone were to build a plugin to save form submissions in the wordpress database, they’d have to have the user select the custom action on every form to make sure that they get saved.
Not the end of the world. Just a thought I had.
I had thought that maybe I could force it to be selected with the new settings filter in 1.5, but it doesn’t seem to care if I modify the actions array:
add_filter( 'bricks/element/settings', function( $settings, $element ) {
if ( $element->name === 'form') {
if (!isset($settings['actions'])) {
$settings['actions'] = ['custom'];
} else if (!in_array('custom',$settings['actions'])) {
array_push($settings['actions'],'custom');
}
}
return $settings;
}, 10, 2 );