diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index ccb11de728..72ffc8dc37 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2139,12 +2139,13 @@ function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) { } else { $value = apply_filters( "post_{$field}", $value, $post_id, $context ); } - } - if ( 'attribute' == $context ) - $value = esc_attr($value); - elseif ( 'js' == $context ) - $value = esc_js($value); + if ( 'attribute' == $context ) { + $value = esc_attr( $value ); + } elseif ( 'js' == $context ) { + $value = esc_js( $value ); + } + } return $value; }