From e5397947482422b3c7a11b16641ba5feae64c551 Mon Sep 17 00:00:00 2001 From: Erick Hitter <ehitter@gmail.com> Date: Sun, 21 Jul 2013 11:48:52 -0400 Subject: [PATCH] Minimal text changes in the admin for consistency with forthcoming end-date meta. --- eth-timeline.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/eth-timeline.php b/eth-timeline.php index 1fc0c3d..f0590ac 100644 --- a/eth-timeline.php +++ b/eth-timeline.php @@ -58,6 +58,8 @@ class ETH_Timeline { private function setup() { add_action( 'init', array( $this, 'action_init' ) ); add_action( 'save_post', array( $this, 'action_save_post' ) ); + + add_filter( 'gettext', array( $this, 'filter_gettext' ) ); add_filter( 'enter_title_here', array( $this, 'filter_editor_title_prompt' ), 10, 2 ); } @@ -144,6 +146,36 @@ class ETH_Timeline { } } + /** + * Translate certain admin strings for relevance + * + * @param string $text + * @uses is_admin + * @uses get_current_screen + * @uses is_wp_error + * @filter gettext + * @return string + */ + public function filter_gettext( $text ) { + if ( is_admin() && function_exists( 'get_current_screen' ) ) { + $screen = get_current_screen(); + + if ( is_object( $screen ) && ! is_wp_error( $screen ) && $this->post_type == $screen->post_type ) { + $text = str_replace( array( + 'Published on', + 'Publish', + ), array( + 'Start', + 'Start' + ), $text ); + } + + + } + + return $text; + } + /** * Provide better prompt text for the editor title field * -- GitLab