Skip to content

Instantly share code, notes, and snippets.

@antoniofrignani
Created June 4, 2012 09:34
Show Gist options
  • Save antoniofrignani/2867440 to your computer and use it in GitHub Desktop.
Save antoniofrignani/2867440 to your computer and use it in GitHub Desktop.
[WP] - Change publish metabox text for custom post type
// http://wpsnipp.com/index.php/functions-php/change-publish-metabox-text-for-custom-post-type/
function wps_translation_mangler($translation, $text, $domain) {
global $post;
if ($post->post_type == 'events') {
$translations = &get_translations_for_domain( $domain);
if ( $text == 'Scheduled for: <b>%1$s</b>') {
return $translations->translate( 'Event Date: <b>%1$s</b>' );
}
if ( $text == 'Published on: <b>%1$s</b>') {
return $translations->translate( 'Event Date: <b>%1$s</b>' );
}
if ( $text == 'Publish <b>immediately</b>') {
return $translations->translate( 'Event Date: <b>%1$s</b>' );
}
}
return $translation;
}
add_filter('gettext', 'wps_translation_mangler', 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment