Created
September 12, 2017 14:20
-
-
Save braddalton/5bf9bae674ba662dda86f3e5484c9edb to your computer and use it in GitHub Desktop.
Rename Post Formats In WordPress https://wp.me/p1lTu0-h6Q
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
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