I think what you really want is to de-register the css. You can do that with the following code snippet:
add_action("gform_enqueue_scripts", "deregister_style");
function deregister_style(){
wp_deregister_style("gforms_css");
}
Gravity Forms only enqueues the scripts that it needs. For example, if you select a date-picker field, the datepicker.js script will be enqueued. If you use conditional logic, the conditional_logic.js script will be enqueued. If you don't select any feature that requires client side scripting, no scripts will be enqueued. So the best way to prevent client scripts from being enqueued is to simply not use fields/features that require client side scripts.
Having said that, the following code snippet will de-register all scripts that can possibly be enqueued by Gravity Forms:
add_action("gform_enqueue_scripts", "deregister_scripts");
function deregister_scripts(){
wp_deregister_script("gforms_conditional_logic_lib");
wp_deregister_script("gforms_ui_datepicker");
wp_deregister_script("gforms_gravityforms");
wp_deregister_script("gforms_character_counter");
wp_deregister_script("gforms_json");
wp_deregister_script("jquery");
}
Posted 12 years ago on Thursday August 11, 2011 |
Permalink