Created
September 3, 2022 11:38
-
-
Save ahmedch1/ccdad5f700637d2fbc402f40c8d1204d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( !is_user_logged_in() ) { | |
| function sanitize_output($buffer) { | |
| $search = array( | |
| '/\>[^\S ]+/s', // strip whitespaces after tags, except space | |
| '/[^\S ]+\</s', // strip whitespaces before tags, except space | |
| '/(\s)+/s' // shorten multiple whitespace sequences | |
| ); | |
| $replace = array( | |
| '>', | |
| '<', | |
| '\\1' | |
| ); | |
| $buffer = preg_replace($search, $replace, $buffer); | |
| return $buffer; | |
| } | |
| ob_start("sanitize_output"); | |
| } | |
| Source : https://www.quora.com/How-can-I-manually-speed-up-my-wordpress-site-without-plugins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment