-
-
Save pagelab/939671c131079b406be5b3ca15c266b7 to your computer and use it in GitHub Desktop.
WordPress Filter - Trim Excerpt Whitespace
This file contains 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
<?php | |
// trim excerpt whitespace | |
if ( !function_exists( 'mp_trim_excerpt_whitespace' ) ) { | |
function mp_trim_excerpt_whitespace( $excerpt ) { | |
return trim( $excerpt ); | |
} | |
add_filter( 'get_the_excerpt', 'mp_trim_excerpt_whitespace', 1 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Via https://mindpalette.com/2019/03/wordpress-excerpts-empty-but-post-has-content/