From 644022859667940c91e50fe893fa7fc142258b86 Mon Sep 17 00:00:00 2001 From: Nestor Ochoa Date: Fri, 25 Nov 2016 17:28:56 +1100 Subject: [PATCH] Change to fix issue #69 Error not saving paragrafs on WYSIWYG --- src/acf_5/fields/wysiwyg.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/acf_5/fields/wysiwyg.php b/src/acf_5/fields/wysiwyg.php index 610b331..06c4f5c 100644 --- a/src/acf_5/fields/wysiwyg.php +++ b/src/acf_5/fields/wysiwyg.php @@ -114,8 +114,7 @@ function render_field($field) { // filter value for editor remove_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 ); - remove_filter( 'acf_the_editor_content', 'wp_htmledit_pre', 10, 1 ); - remove_filter( 'acf_the_editor_content', 'wp_richedit_pre', 10, 1 ); + // WP 4.3 @@ -127,7 +126,9 @@ function render_field($field) { // WP < 4.3 } else { - + remove_filter( 'acf_the_editor_content', 'wp_htmledit_pre', 10, 1 ); + remove_filter( 'acf_the_editor_content', 'wp_richedit_pre', 10, 1 ); + $function = ($default_editor === 'html') ? 'wp_htmledit_pre' : 'wp_richedit_pre'; add_filter('acf_the_editor_content', $function, 10, 1);