Core Booster Hooks – gfpdf_form_field_selector_sort_enabled
Description
This filter can be used to disable the field reordering feature in the Field Selector setting.
Arguments
The following arguments are passed to functions that use this hook:
$enabled | bool
- Whether field reordering is enabled or disabled
- The default value is
true
$form_id | int
- the current form ID the PDF is created on
Usage
Disable the reordering feature in the Field Selector setting:
add_filter( 'gfpdf_form_field_selector_sort_enabled', '__return_false' );
Use this snippet to disable the feature on specific forms (change the numbers 10, 11, 12
to match your specific form IDs):
add_filter( 'gfpdf_form_field_selector_sort_enabled', function ( $enabled, $form_id ) {
if ( in_array( (int) $form_id, [ 10, 11, 12 ], true ) ) {
return false;
}
return $enabled;
}, 10, 2 );