Skip to content

Instantly share code, notes, and snippets.

@alpha1
Last active August 29, 2015 14:27
Show Gist options
  • Save alpha1/ee96eb4e1e1510f2e840 to your computer and use it in GitHub Desktop.
Save alpha1/ee96eb4e1e1510f2e840 to your computer and use it in GitHub Desktop.
Gravity Forms: Allow (Displaying) HTML in notes
<?php
/*
This will allow Gravity Forms Notes to display HTML. You can already add html to notes, but it will be displayed out as code.
*/
add_action('gform_entry_detail','gravity_forms_add_filter_allow_html');
add_action('gform_entry_detail_content_before','gravity_forms_add_filter_allow_html');
add_action('gform_entry_detail_content_after','gravity_forms_remove_filter_allow_html');
function gravity_forms_add_filter_allow_html(){
add_filter('esc_html','gravity_forms_notes_allow_html',10,2);
}
function gravity_forms_remove_filter_allow_html(){
remove_filter('esc_html','gravity_forms_notes_allow_html',10);
}
function gravity_forms_notes_allow_html($safe_text, $text){
return wp_kses_post($text);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment