From 4dfd9793fd993653dab256b16431f1a0df6f946a Mon Sep 17 00:00:00 2001 From: Thrijith Thankachan Date: Sun, 7 Jan 2018 17:02:50 +0530 Subject: [PATCH] fix wpcs -m update code to remove wpcs warnings #109 --- templates/post_type_extended.mustache | 38 +++++++++++++++++++-------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/templates/post_type_extended.mustache b/templates/post_type_extended.mustache index d0302fa34..ff17bd342 100644 --- a/templates/post_type_extended.mustache +++ b/templates/post_type_extended.mustache @@ -1,10 +1,18 @@ '', // Unused. Messages start at index 1. - 1 => sprintf( __('{{label_ucfirst}} updated. View {{label}}', '{{textdomain}}'), esc_url( $permalink ) ), - 2 => __('Custom field updated.', '{{textdomain}}'), - 3 => __('Custom field deleted.', '{{textdomain}}'), - 4 => __('{{label_ucfirst}} updated.', '{{textdomain}}'), + /* translators: %s: permalink of {{label}}*/ + 1 => sprintf( __( '{{label_ucfirst}} updated. View {{label}}', '{{textdomain}}' ), esc_url( $permalink ) ), + 2 => __( 'Custom field updated.', '{{textdomain}}' ), + 3 => __( 'Custom field deleted.', '{{textdomain}}' ), + 4 => __( '{{label_ucfirst}} updated.', '{{textdomain}}' ), /* translators: %s: date and time of the revision */ - 5 => isset($_GET['revision']) ? sprintf( __('{{label_ucfirst}} restored to revision from %s', '{{textdomain}}'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, - 6 => sprintf( __('{{label_ucfirst}} published. View {{label}}', '{{textdomain}}'), esc_url( $permalink ) ), - 7 => __('{{label_ucfirst}} saved.', '{{textdomain}}'), - 8 => sprintf( __('{{label_ucfirst}} submitted. Preview {{label}}', '{{textdomain}}'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), - 9 => sprintf( __('{{label_ucfirst}} scheduled for: %1$s. Preview {{label}}', '{{textdomain}}'), - // translators: Publish box date format, see https://secure.php.net/manual/en/function.date.php + 5 => isset( $_GET['revision'] ) ? sprintf( __( '{{label_ucfirst}} restored to revision from %s', '{{textdomain}}' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, + /* translators: %s: permalink of {{label}}*/ + 6 => sprintf( __( '{{label_ucfirst}} published. View {{label}}', '{{textdomain}}' ), esc_url( $permalink ) ), + 7 => __( '{{label_ucfirst}} saved.', '{{textdomain}}' ), + /* translators: %s: permalink of {{label}}*/ + 8 => sprintf( __( '{{label_ucfirst}} submitted. Preview {{label}}', '{{textdomain}}' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + + /* + * translators: %1$s :Publish box date format, see https://secure.php.net/manual/en/function.date.php. + * translators: %2$s: permalink of {{label}} + */ + 9 => sprintf( __( '{{label_ucfirst}} scheduled for: %1$s. Preview {{label}}', '{{textdomain}}' ), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ), - 10 => sprintf( __('{{label_ucfirst}} draft updated. Preview {{label}}', '{{textdomain}}'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + /* translators: %s: permalink of {{label}}*/ + 10 => sprintf( __( '{{label_ucfirst}} draft updated. Preview {{label}}', '{{textdomain}}' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), ); return $messages;