Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Last active December 20, 2015 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WerdsWords/6092862 to your computer and use it in GitHub Desktop.
Save WerdsWords/6092862 to your computer and use it in GitHub Desktop.
#23: wp_sprintf_l
<?php
/**
* Remove use of Oxford/serial comma at the end of taxonomy lists
*
* @param array $separators The array of defaul list item separators.
*
* @return array The filtered list of list separators.
*/
function wpdocs_no_oxford_comma( $separators ) {
// Replaces __( ', and ' )
$separators['between_last_two'] = __( ' and ' );
return $separators;
}
add_filter( 'wp_sprintf_l', 'wpdocs_no_oxford_comma' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment