wordpress rename post format

Solutions on MaxInterview for wordpress rename post format by the best coders in the world

showing results for - "wordpress rename post format"
Alessandra
10 Sep 2019
1add_theme_support( 'post-formats', array('aside','video','gallery','chat'));
2
3function rename_post_formats($translation, $text, $context, $domain) {
4    $names = array(
5        'Aside'  => 'No Featured image',
6        'Chat'  => 'Full Width',
7    );
8    if ($context == 'Post format') {
9        $translation = str_replace(array_keys($names), array_values($names), $text);
10    }
11    return $translation;
12}
13add_filter('gettext_with_context', 'rename_post_formats', 10, 4);