From 404043cafce406bf6079ab43807aaebeb0ad2749 Mon Sep 17 00:00:00 2001 From: Daniel Seripap <683200+seripap@users.noreply.github.com> Date: Thu, 4 Nov 2021 11:58:32 -0400 Subject: [PATCH] Check if value is string before applying filter, fixes #564 --- includes/fields/class-acf-field-wysiwyg.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/fields/class-acf-field-wysiwyg.php b/includes/fields/class-acf-field-wysiwyg.php index 367e295a..6617645d 100644 --- a/includes/fields/class-acf-field-wysiwyg.php +++ b/includes/fields/class-acf-field-wysiwyg.php @@ -428,12 +428,15 @@ function format_value( $value, $post_id, $field ) { return $value; } + + if ( is_string( $value ) ) { - // apply filters - $value = apply_filters( 'acf_the_content', $value ); + // apply filters + $value = apply_filters( 'acf_the_content', $value ); - // follow the_content function in /wp-includes/post-template.php - $value = str_replace( ']]>', ']]>', $value ); + // follow the_content function in /wp-includes/post-template.php + $value = str_replace( ']]>', ']]>', $value ); + } return $value; }