WP_Importer::min_whitespace() WordPress Method
The WP_Importer::min_whitespace() method is used to remove any extra whitespace from a string. This is useful when cleaning up imported content, as it can help to remove any invalid characters that may have been introduced during the import process.
WP_Importer::min_whitespace( string $text ) #
Replace newlines, tabs, and multiple spaces with a single space.
Contents
Parameters
- $text
(string)(Required)
Return
(string)
Source
File: wp-admin/includes/class-wp-importer.php
public function min_whitespace( $text ) { return preg_replace( '|[\r\n\t ]+|', ' ', $text ); }
Expand full source codeCollapse full source codeView on TracView on GitHub