Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Created July 22, 2013 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WerdsWords/6054786 to your computer and use it in GitHub Desktop.
Save WerdsWords/6054786 to your computer and use it in GitHub Desktop.
#15: the_content
<?php
/**
* Convert double-spaced sentence endings to singles
*
* @param string $content The post content.
*
* @return string The filtered post content.
*/
function wpdocs_double_spaces_to_singles( $content ) {
// Replaces '. ' with '. '
$content = str_replace( '. ', '. ', $content );
return $content;
}
add_filter( 'the_content', 'wpdocs_double_spaces_to_singles' );
@WerdsWords
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment