Crocoblock / suggestions

The suggestions for CrocoBlock project
191 stars 78 forks source link

JetFormBuilder - Add alternative filter for `jet-engine-extend-form-actions/config` #7504

Open edgb0lw opened 2 months ago

edgb0lw commented 2 months ago

YOU CAN IGNORE THIS REQUEST AS I HAVE MADE IT BEFORE, BUT IT WAS ACCIDENTALLY DELETED SOMEHOW


With the filter jet-engine-extend-form-actions/config you can do many useful things, such as merging several fields into one value or applying certain fields to things that are still not natively possible. If you have added an insert post submit action in the JetForm, there is no field where you can set the post slug (post_name).

This is automatically derived from the title field. But in my case I need exactly that, that the user has a separate field for it. With the legacy JetEngine forms version this was possible with the following filter. Can you please add this for the JetFormBuilder as well?

add_filter( 'jet-engine-extend-form-actions/config', function() {
    return [
        /* form ID */ => [
            'post-slug-field' => [
                'prop' => 'post_data',
                'key' => 'post_name'
            ]
        ]
    ];
} );

Thank you in advance! :) Edgar