We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
strip_html_newlines()
1 parent 3263257 commit 3d36f58Copy full SHA for 3d36f58
src/wp-includes/formatting.php
@@ -868,6 +868,14 @@ function shortcode_unautop( $text ) {
868
return preg_replace( $pattern, '$1', $text );
869
}
870
871
+/**
872
+ * Strips unnecessary newlines from HTML content.
873
+ *
874
+ * @since 7.1.0
875
876
+ * @param string $text The HTML content to strip newlines from.
877
+ * @return string The HTML content with unnecessary newlines removed.
878
+ */
879
function strip_html_newlines( $text ) {
880
if ( ! str_contains( $text, "\n" ) && ! str_contains( $text, "\r" ) ) {
881
return $text;
0 commit comments