Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Since WP 3.1, it's been possible to use Tumblr-style post formats. I want to use the 'aside' option in a theme, but I want it to have a different title in the WP admin area.

So, for example, when a user is writing a post, they have the option for the post to be, say, either 'Standard' or 'Quick' -- rather than 'Standard' or 'Aside'.

Is it possible to do this without modifying the core? It'd be great if it's something that could be pretty easily done via functions.php or the like. I live in hope...

Thanks!

share|improve this question

5 Answers 5

up vote 7 down vote accepted

I think this is the only way for now. Put this in your functions.php in your theme folder or create a simple plugin:

function rename_post_formats( $safe_text ) {
    if ( $safe_text == 'Aside' )
        return 'Quick';

    return $safe_text;
}
add_filter( 'esc_html', 'rename_post_formats' );

//rename Aside in posts list table
function live_rename_formats() { 
    global $current_screen;

    if ( $current_screen->id == 'edit-post' ) { ?>
        <script type="text/javascript">
        jQuery('document').ready(function() {

            jQuery("span.post-state-format").each(function() { 
                if ( jQuery(this).text() == "Aside" )
                    jQuery(this).text("Quick");             
            });

        });      
        </script>
<?php }
}
add_action('admin_head', 'live_rename_formats');
share|improve this answer

A much more reliable (and less hacky) way to do this would be the following:

function rename_post_formats($translation, $text, $context, $domain) {
    $names = array(
        'Audio'  => 'Podcast',
        'Status' => 'Tweet'
    );
    if ($context == 'Post format') {
        $translation = str_replace(array_keys($names), array_values($names), $text);
    }
    return $translation;
}
add_filter('gettext_with_context', 'rename_post_formats', 10, 4);
share|improve this answer

Post formats are hard-coded into WordPress. You can't change them, but as JohnnyPea points out you can hide the existing name with a couple of tricks.

Chip Bennett recommends setting up your own custom taxonomy if you really need to create your own set of post formats, and I strongly second that recommendation.

But take a second to think about this. Post formats are designed to help you style the output of your blog for the reader. The reader doesn't care if it's called an Aside or a Quick, they just care how the post content is presented. If you're just trying to change the post format label on the admin side for yourself, then please just roll your own custom taxonomy and use that.

share|improve this answer

The correct method would be to register a custom taxonomy, and not use core Post Formats at all.

share|improve this answer

I've customized the post formats and display them in a tab bar horizontally along the top of the post editor page. I customize their names a lil somethin like this. It is quite an involved and hackish process but I pasted it into a Gist if you'd like to check it out: https://gist.github.com/dcondrey/059dec0c5b01197c9f11

Final result comes out looking somethin like this:

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.