Last active
December 20, 2015 07:19
-
-
Save WerdsWords/6092862 to your computer and use it in GitHub Desktop.
#23: wp_sprintf_l
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 | |
/** | |
* 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