@@ -208,17 +208,6 @@ public function init() {
208
208
209
209
load_plugin_textdomain ( $ this ->_slug , false , basename ( dirname ( __file__ ) ) . '/languages/ ' );
210
210
211
- if ( current_user_can ( 'administrator ' ) ) {
212
- add_filter ( 'gform_tooltips ' , array ( $ this , 'tooltips ' ) );
213
- add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'enqueue_editor_script ' ) );
214
- add_action ( 'gform_post_save_feed_settings ' , array ( $ this , 'save_code_chest_settings ' ), 10 , 4 );
215
- add_filter ( 'gform_noconflict_scripts ' , array ( $ this , 'noconflict_scripts ' ) );
216
- add_filter ( 'gform_noconflict_styles ' , array ( $ this , 'noconflict_styles ' ) );
217
-
218
- // 11 so that this comes right after and can override the legacy Custom JS plugin setting config.
219
- add_filter ( 'gform_form_settings_fields ' , array ( $ this , 'replace_custom_js_setting ' ), 11 , 2 );
220
- }
221
-
222
211
add_filter ( 'gform_register_init_scripts ' , array ( $ this , 'register_init_script ' ), 99 , 1 );
223
212
add_filter ( 'gform_register_init_scripts ' , array ( $ this , 'maybe_register_custom_js_scripts_first ' ), 100 , 1 );
224
213
@@ -240,6 +229,18 @@ public function init() {
240
229
add_action ( 'gform_post_form_duplicated ' , array ( $ this , 'duplicate_form_feeds ' ), 10 , 2 );
241
230
}
242
231
232
+ public function init_admin () {
233
+ parent ::init_admin ();
234
+
235
+ add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'enqueue_editor_script ' ) );
236
+ add_action ( 'gform_post_save_feed_settings ' , array ( $ this , 'save_code_chest_settings ' ), 10 , 4 );
237
+ add_filter ( 'gform_noconflict_scripts ' , array ( $ this , 'noconflict_scripts ' ) );
238
+ add_filter ( 'gform_noconflict_styles ' , array ( $ this , 'noconflict_styles ' ) );
239
+
240
+ // 11 so that this comes right after and can override the legacy Custom JS plugin setting config.
241
+ add_filter ( 'gform_form_settings_fields ' , array ( $ this , 'replace_custom_js_setting ' ), 11 , 2 );
242
+ }
243
+
243
244
public function enqueue_editor_script () {
244
245
if ( GFForms::get_page () !== 'form_settings_gf-code-chest ' ) {
245
246
return ;
@@ -423,17 +424,6 @@ public function get_custom_css( $form ) {
423
424
return rgar ( $ settings , 'code_chest_css ' );
424
425
}
425
426
426
- /**
427
- * Registers tooltips with Gravity Forms. Needed for some things like radio choices.
428
- *
429
- * @param $tooltips array Existing tooltips.
430
- *
431
- * @return array
432
- */
433
- public function tooltips ( $ tooltips ) {
434
- return $ tooltips ;
435
- }
436
-
437
427
public function feed_settings_fields () {
438
428
$ form_id = rgget ( 'id ' );
439
429
$ form = GFAPI ::get_form ( $ form_id );
0 commit comments