Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created September 12, 2017 14:20
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 braddalton/5bf9bae674ba662dda86f3e5484c9edb to your computer and use it in GitHub Desktop.
Save braddalton/5bf9bae674ba662dda86f3e5484c9edb to your computer and use it in GitHub Desktop.
Rename Post Formats In WordPress https://wp.me/p1lTu0-h6Q
add_filter( 'gettext_with_context', 'rename_post_formats', 10, 4 );
function rename_post_formats( $translation, $text, $context, $domain ) {
$names = array(
'Audio' => 'Custom Name',
'Chat' => 'Custom Name',
'Aside' => 'Custom Name',
);
if ( $context == 'Post format' ) {
$translation = str_replace( array_keys( $names ), array_values( $names ), $text );
}
return $translation;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment