1

I am using the date and time in the post dialogue to log the date and time of future events, and would like to change the text to reflect that.

Is there an action hook I can tap into to achieve that?

Also, it would be perfect if I could pull those controls out of the 'publish dialogue', and add it to my own meta box.

Publish dialogue

1
  • Friendly reminder to mark a correct answer, or provide feedback if your question wasn't sufficiently answered. :)
    – t31os
    Dec 9, 2011 at 16:09

1 Answer 1

2

Use a gettext filter and match against the text.

add_filter( 'gettext', 'filter_published_on', 10000, 2 );
function filter_published_on( $trans, $text ) {

    if( 'Published on: <b>%1$s</b>' == $text ) {
        global $post;
        switch( $post->post_type ) {
            case 'your-posttype': 
                return 'Whatever on: <strong>%1$s</strong>';
            break;
            default: 
                return $trans;
            break;
        }
    }
    return $trans;
}

The alternative would be to copy the publish metabox code, and change the callback function for that metabox to your copied(and modified) version of the function, so you can do what you want with the callback code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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