Description
Allows the post meta query, which retrieves the custom field names (meta keys), to be disabled to help improve editor performance on some sites.
Note: If your form has a post custom field and you enable this filter, you won’t be able to map it to a custom field.
Usage
add_filter( 'gform_disable_custom_field_names_query', 'your_function_name', 10, 1 );
Parameters
- $disable_query boolean
Indicates if the custom field names query should be disabled. Default is false.
Example
add_filter( 'gform_disable_custom_field_names_query', 'disable_query', 10, 1 );
function disable_query( $disable_query ) {
return true;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms version 2.3.4.1.
Source Code
This filter is located in GFFormsModel::get_custom_field_names() in forms_model.php.