DescriptionUsageExamples1. Basic example2. Adding a custom setting to all field types3. Set default date formatSource Code
Description
This action hook can be used to inject Javascript into the form editor page.
Usage
add_action( 'gform_editor_js', 'editor_script' );
Examples
1. Basic example
add_action( 'gform_editor_js', 'editor_script' );
function editor_script(){
echo '';
}
2. Adding a custom setting to all field types
This example adds a custom setting, which has been implemented using gform_field_standard_settings, gform_field_appearance_settings, or gform_field_advanced_settings, to the fields.
add_action( 'gform_editor_js', function () {
echo '' . PHP_EOL;
} );
3. Set default date format
This example sets the default date format for date type fields to dmy_dot.
add_action( 'gform_editor_js', function () {
echo '' . PHP_EOL;
} );
Source Code
This filter is located in js.php.