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.

ANSWER MOD: just an important mod to the chosen answer:

// check if you actually have drafts; also avoids extra '|' separator
if (isset($views['draft'])) {
    // 'Drafts' should be added (and come first) if you don't want to end up with 'Unavailables'
    $views['draft'] = str_replace(array('Drafts','Draft'), 'Unavailable', $views['draft']);
}

and the mentioned caveat is not showing up for me on 3.4. :D


Only for one particular custom post type employee, I want to change the name/string "Draft" (which stands for the 'draft' status) to "Unavailable" for any employee post that has a 'draft' status, anywhere the name shows up on the admin screens and basically throughout the entire site, i.e.

enter image description here

Is there a hook for this? Or is there a better way to do this?

share|improve this question
    
Take a look at register_post_status function codex.wordpress.org/Function_Reference/register_post_status but it's not enough in your case. –  Eugene Manuilov Jun 6 '12 at 5:35
    
hm.. thanks, @EugeneManuilov will look into that for sure. –  Ana Ban Jun 6 '12 at 6:17
add comment

1 Answer 1

up vote 1 down vote accepted

I was investigating the issue for this question, and one option is using the plugin Edit Flow.

It can be configured to display custom post_status in specific CPT's, but further tests are necessary to see if it applies to this case.


Other option is using toscho's Retranslate plugin, where you can define the string to be translated and the post_type: http://wordpress.stackexchange.com/a/3675/12615

It gets almost all the job done, because, curiously, there's one string (the very first one of the screenshot) that don't gets translated and one extra code is necessary:

add_filter( 'views_edit-employee', 'wpse_54330_custom_draft_translation', 10, 1);

function wpse_54330_custom_draft_translation( $views ) 
{
    $views['draft'] = str_replace('Draft', 'Unavailable', $views['draft']);
    return $views;
}

One caveat of this method is that just after "quick editing" the post status, the word Draft appears...

share|improve this answer
    
interesting, will defs work on this and get back to you. am also lookin into the gettext filter with a conditional for the post type. will post what i end up doing once i've sorted it out. thanks @brasofilo –  Ana Ban Jun 15 '12 at 3:32
    
that is, if those "Draft" strings are passed on to gettext.. –  Ana Ban Jun 15 '12 at 3:38
    
this is actually working mighty fine fo'me! no such caveat on wp3.4. thanks much you epic you... lol! just had to insert 'Drafts' in there, see my question edit. :D –  Ana Ban Jun 27 '12 at 8:26
add comment

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.