Changeset 34473
- Timestamp:
- 09/24/2015 03:27:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r34461 r34473 82 82 83 83 $messages = array(); 84 $post_preview_url = get_preview_post_link( $post ); 85 86 $preview_link_html = $scheduled_link_html = $view_post_html = ''; 84 85 $preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = ''; 86 $preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = ''; 87 88 $preview_url = get_preview_post_link( $post ); 87 89 88 90 $viewable = is_post_type_viewable( $post_type_object ); 89 91 90 92 if ( $viewable ) { 91 // Preview link. 92 $preview_link_html = sprintf( ' <a target="_blank" href="%s">%s</a>', 93 esc_url( $post_preview_url ), 93 94 // Preview post link. 95 $preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 96 esc_url( $preview_url ), 94 97 __( 'Preview post' ) 95 98 ); 96 99 97 // Scheduled p review link.98 $scheduled_ link_html = sprintf( ' <a target="_blank" href="%s">%s</a>',100 // Scheduled post preview link. 101 $scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 99 102 esc_url( $permalink ), 100 103 __( 'Preview post' ) … … 102 105 103 106 // View post link. 104 $view_post_ html = sprintf( ' <a href="%s">%s</a>',107 $view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', 105 108 esc_url( $permalink ), 106 109 __( 'View post' ) 107 110 ); 111 112 // Preview page link. 113 $preview_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 114 esc_url( $preview_url ), 115 __( 'Preview page' ) 116 ); 117 118 // Scheduled page preview link. 119 $scheduled_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', 120 esc_url( $permalink ), 121 __( 'Preview page' ) 122 ); 123 124 // View page link. 125 $view_page_link_html = sprintf( ' <a href="%1$s">%2$s</a>', 126 esc_url( $permalink ), 127 __( 'View page' ) 128 ); 129 108 130 } 109 131 110 132 /* translators: Publish box date format, see http://php.net/date */ 111 133 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ); 134 112 135 $messages['post'] = array( 113 136 0 => '', // Unused. Messages start at index 1. 114 1 => __( 'Post updated.' ) . $view_post_ html,115 2 => __( 'Custom field updated.'),116 3 => __( 'Custom field deleted.'),117 4 => __( 'Post updated.'),137 1 => __( 'Post updated.' ) . $view_post_link_html, 138 2 => __( 'Custom field updated.' ), 139 3 => __( 'Custom field deleted.' ), 140 4 => __( 'Post updated.' ), 118 141 /* translators: %s: date and time of the revision */ 119 142 5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 120 6 => __( 'Post published.' ) . $view_post_ html,121 7 => __( 'Post saved.'),122 8 => __( 'Post submitted.' ) . $preview_ link_html,123 9 => sprintf( __( 'Post scheduled for: <strong>%1$s</strong>' ), $scheduled_date ) . $scheduled_link_html,124 10 => __( 'Post draft updated.' ) . $preview_ link_html,143 6 => __( 'Post published.' ) . $view_post_link_html, 144 7 => __( 'Post saved.' ), 145 8 => __( 'Post submitted.' ) . $preview_post_link_html, 146 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, 147 10 => __( 'Post draft updated.' ) . $preview_post_link_html, 125 148 ); 126 127 $page_preview_url = get_preview_post_link( $post );128 129 149 $messages['page'] = array( 130 150 0 => '', // Unused. Messages start at index 1. 131 1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( $permalink ) ), 132 2 => __('Custom field updated.'), 133 3 => __('Custom field deleted.'), 134 4 => __('Page updated.'), 151 1 => __( 'Page updated.' ) . $view_page_link_html, 152 2 => __( 'Custom field updated.' ), 153 3 => __( 'Custom field deleted.' ), 154 4 => __( 'Page updated.' ), 155 /* translators: %s: date and time of the revision */ 135 156 5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 136 6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( $permalink ) ),137 7 => __( 'Page saved.'),138 8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( $page_preview_url ) ),139 9 => sprintf( __( 'Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ),140 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( $page_preview_url ) ),157 6 => __( 'Page published.' ) . $view_page_link_html, 158 7 => __( 'Page saved.' ), 159 8 => __( 'Page submitted.' ) . $preview_page_link_html, 160 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, 161 10 => __( 'Page draft updated.' ) . $preview_page_link_html, 141 162 ); 142 163 $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now.
Note: See TracChangeset
for help on using the changeset viewer.