Change the ‘published on’ text?

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?

Read More

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

Related posts

Leave a Reply

1 comment

  1. 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.