157 __( 'View page' ) |
164 __( 'View page' ) |
158 ); |
165 ); |
159 |
166 |
160 } |
167 } |
161 |
168 |
162 /* translators: Publish box date format, see https://secure.php.net/date */ |
169 $scheduled_date = sprintf( |
163 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ); |
170 /* translators: Publish box date string. 1: Date, 2: Time. */ |
|
171 __( '%1$s at %2$s' ), |
|
172 /* translators: Publish box date format, see https://www.php.net/date */ |
|
173 date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ), |
|
174 /* translators: Publish box time format, see https://www.php.net/date */ |
|
175 date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) |
|
176 ); |
164 |
177 |
165 $messages['post'] = array( |
178 $messages['post'] = array( |
166 0 => '', // Unused. Messages start at index 1. |
179 0 => '', // Unused. Messages start at index 1. |
167 1 => __( 'Post updated.' ) . $view_post_link_html, |
180 1 => __( 'Post updated.' ) . $view_post_link_html, |
168 2 => __( 'Custom field updated.' ), |
181 2 => __( 'Custom field updated.' ), |
169 3 => __( 'Custom field deleted.' ), |
182 3 => __( 'Custom field deleted.' ), |
170 4 => __( 'Post updated.' ), |
183 4 => __( 'Post updated.' ), |
171 /* translators: %s: date and time of the revision */ |
184 /* translators: %s: Date and time of the revision. */ |
172 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
185 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
173 6 => __( 'Post published.' ) . $view_post_link_html, |
186 6 => __( 'Post published.' ) . $view_post_link_html, |
174 7 => __( 'Post saved.' ), |
187 7 => __( 'Post saved.' ), |
175 8 => __( 'Post submitted.' ) . $preview_post_link_html, |
188 8 => __( 'Post submitted.' ) . $preview_post_link_html, |
|
189 /* translators: %s: Scheduled date for the post. */ |
176 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, |
190 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, |
177 10 => __( 'Post draft updated.' ) . $preview_post_link_html, |
191 10 => __( 'Post draft updated.' ) . $preview_post_link_html, |
178 ); |
192 ); |
179 $messages['page'] = array( |
193 $messages['page'] = array( |
180 0 => '', // Unused. Messages start at index 1. |
194 0 => '', // Unused. Messages start at index 1. |
181 1 => __( 'Page updated.' ) . $view_page_link_html, |
195 1 => __( 'Page updated.' ) . $view_page_link_html, |
182 2 => __( 'Custom field updated.' ), |
196 2 => __( 'Custom field updated.' ), |
183 3 => __( 'Custom field deleted.' ), |
197 3 => __( 'Custom field deleted.' ), |
184 4 => __( 'Page updated.' ), |
198 4 => __( 'Page updated.' ), |
185 /* translators: %s: date and time of the revision */ |
199 /* translators: %s: Date and time of the revision. */ |
186 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
200 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
187 6 => __( 'Page published.' ) . $view_page_link_html, |
201 6 => __( 'Page published.' ) . $view_page_link_html, |
188 7 => __( 'Page saved.' ), |
202 7 => __( 'Page saved.' ), |
189 8 => __( 'Page submitted.' ) . $preview_page_link_html, |
203 8 => __( 'Page submitted.' ) . $preview_page_link_html, |
|
204 /* translators: %s: Scheduled date for the page. */ |
190 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, |
205 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, |
191 10 => __( 'Page draft updated.' ) . $preview_page_link_html, |
206 10 => __( 'Page draft updated.' ) . $preview_page_link_html, |
192 ); |
207 ); |
193 $messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now. |
208 $messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now. |
194 |
209 |
225 |
240 |
226 $form_action = 'editpost'; |
241 $form_action = 'editpost'; |
227 $nonce_action = 'update-post_' . $post_ID; |
242 $nonce_action = 'update-post_' . $post_ID; |
228 $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post_ID ) . "' />"; |
243 $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post_ID ) . "' />"; |
229 |
244 |
230 // Detect if there exists an autosave newer than the post and if that autosave is different than the post |
245 // Detect if there exists an autosave newer than the post and if that autosave is different than the post. |
231 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { |
246 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { |
232 foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) { |
247 foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) { |
233 if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { |
248 if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) { |
234 $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) ); |
249 $notice = sprintf( |
|
250 /* translators: %s: URL to view the autosave. */ |
|
251 __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), |
|
252 get_edit_post_link( $autosave->ID ) |
|
253 ); |
235 break; |
254 break; |
236 } |
255 } |
237 } |
256 } |
238 // If this autosave isn't different from the current post, begone. |
257 // If this autosave isn't different from the current post, begone. |
239 if ( ! $notice ) { |
258 if ( ! $notice ) { |
272 $title_and_editor .= '<p>' . __( '<strong>Post editor</strong> — Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>'; |
291 $title_and_editor .= '<p>' . __( '<strong>Post editor</strong> — Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>'; |
273 $title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>'; |
292 $title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>'; |
274 $title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that <p> and <br> tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing <br>, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>'; |
293 $title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that <p> and <br> tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing <br>, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>'; |
275 $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>'; |
294 $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>'; |
276 $title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>'; |
295 $title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>'; |
277 $title_and_editor .= '<p>' . __( 'Keyboard users: When you’re working in the visual editor, you can use <kbd>Alt + F10</kbd> to access the toolbar.' ) . '</p>'; |
296 $title_and_editor .= '<p>' . sprintf( |
|
297 /* translators: %s: Alt + F10 */ |
|
298 __( 'Keyboard users: When you’re working in the visual editor, you can use %s to access the toolbar.' ), |
|
299 '<kbd>Alt + F10</kbd>' |
|
300 ) . '</p>'; |
278 |
301 |
279 get_current_screen()->add_help_tab( |
302 get_current_screen()->add_help_tab( |
280 array( |
303 array( |
281 'id' => 'title-post-editor', |
304 'id' => 'title-post-editor', |
282 'title' => __( 'Title and Post Editor' ), |
305 'title' => __( 'Title and Post Editor' ), |
283 'content' => $title_and_editor, |
306 'content' => $title_and_editor, |
284 ) |
307 ) |
285 ); |
308 ); |
286 |
309 |
287 get_current_screen()->set_help_sidebar( |
310 get_current_screen()->set_help_sidebar( |
288 '<p>' . sprintf( __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), 'tools.php' ) . '</p>' . |
311 '<p>' . sprintf( |
|
312 /* translators: %s: URL to Press This bookmarklet. */ |
|
313 __( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ), |
|
314 'tools.php' |
|
315 ) . '</p>' . |
289 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
316 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
290 '<p>' . __( '<a href="https://codex.wordpress.org/Posts_Add_New_Screen">Documentation on Writing and Editing Posts</a>' ) . '</p>' . |
317 '<p>' . __( '<a href="https://wordpress.org/support/article/wordpress-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' . |
291 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
318 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
292 ); |
319 ); |
293 } elseif ( 'page' == $post_type ) { |
320 } elseif ( 'page' === $post_type ) { |
294 $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>' . |
321 $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>' . |
295 '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>'; |
322 '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>'; |
296 |
323 |
297 get_current_screen()->add_help_tab( |
324 get_current_screen()->add_help_tab( |
298 array( |
325 array( |
302 ) |
329 ) |
303 ); |
330 ); |
304 |
331 |
305 get_current_screen()->set_help_sidebar( |
332 get_current_screen()->set_help_sidebar( |
306 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
333 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
307 '<p>' . __( '<a href="https://codex.wordpress.org/Pages_Add_New_Screen">Documentation on Adding New Pages</a>' ) . '</p>' . |
334 '<p>' . __( '<a href="https://wordpress.org/support/article/pages-add-new-screen/">Documentation on Adding New Pages</a>' ) . '</p>' . |
308 '<p>' . __( '<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages">Documentation on Editing Pages</a>' ) . '</p>' . |
335 '<p>' . __( '<a href="https://wordpress.org/support/article/pages-screen/">Documentation on Editing Pages</a>' ) . '</p>' . |
309 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
336 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
310 ); |
337 ); |
311 } elseif ( 'attachment' == $post_type ) { |
338 } elseif ( 'attachment' === $post_type ) { |
312 get_current_screen()->add_help_tab( |
339 get_current_screen()->add_help_tab( |
313 array( |
340 array( |
314 'id' => 'overview', |
341 'id' => 'overview', |
315 'title' => __( 'Overview' ), |
342 'title' => __( 'Overview' ), |
316 'content' => |
343 'content' => |
317 '<p>' . __( 'This screen allows you to edit four fields for metadata in a file within the media library.' ) . '</p>' . |
344 '<p>' . __( 'This screen allows you to edit fields for metadata in a file within the media library.' ) . '</p>' . |
318 '<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' . |
345 '<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' . |
319 '<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' . |
346 '<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' . |
320 '<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>', |
347 '<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>', |
321 ) |
348 ) |
322 ); |
349 ); |
323 |
350 |
324 get_current_screen()->set_help_sidebar( |
351 get_current_screen()->set_help_sidebar( |
325 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
352 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
326 '<p>' . __( '<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media">Documentation on Edit Media</a>' ) . '</p>' . |
353 '<p>' . __( '<a href="https://wordpress.org/support/article/edit-media/">Documentation on Edit Media</a>' ) . '</p>' . |
327 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
354 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' |
328 ); |
355 ); |
329 } |
356 } |
330 |
357 |
331 if ( 'post' == $post_type || 'page' == $post_type ) { |
358 if ( 'post' === $post_type || 'page' === $post_type ) { |
332 $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>'; |
359 $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>'; |
333 $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. Please refer to the Codex to <a href="https://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>'; |
360 $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href="https://wordpress.org/support/article/embeds/">Learn more about embeds</a>.' ) . '</p>'; |
334 |
361 |
335 get_current_screen()->add_help_tab( |
362 get_current_screen()->add_help_tab( |
336 array( |
363 array( |
337 'id' => 'inserting-media', |
364 'id' => 'inserting-media', |
338 'title' => __( 'Inserting Media' ), |
365 'title' => __( 'Inserting Media' ), |
339 'content' => $inserting_media, |
366 'content' => $inserting_media, |
340 ) |
367 ) |
341 ); |
368 ); |
342 } |
369 } |
343 |
370 |
344 if ( 'post' == $post_type ) { |
371 if ( 'post' === $post_type ) { |
345 $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>'; |
372 $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>'; |
346 $publish_box .= '<ul><li>' . |
373 $publish_box .= '<ul><li>' . |
347 __( '<strong>Publish</strong> — You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) . |
374 __( '<strong>Publish</strong> — You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) . |
348 '</li>'; |
375 '</li>'; |
349 |
376 |
350 if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) { |
377 if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) { |
351 $publish_box .= '<li>' . __( '<strong>Format</strong> — Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="https://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>'; |
378 $publish_box .= '<li>' . __( '<strong>Format</strong> — Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href="https://wordpress.org/support/article/post-formats/#supported-formats">Learn more about each post format</a>.' ) . '</li>'; |
352 } |
379 } |
353 |
380 |
354 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { |
381 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { |
355 /* translators: %s: Featured Image */ |
382 $publish_box .= '<li>' . sprintf( |
356 $publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> — This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>'; |
383 /* translators: %s: Featured image. */ |
|
384 __( '<strong>%s</strong> — This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), |
|
385 esc_html( $post_type_object->labels->featured_image ) |
|
386 ) . '</li>'; |
357 } |
387 } |
358 |
388 |
359 $publish_box .= '</ul>'; |
389 $publish_box .= '</ul>'; |
360 |
390 |
361 get_current_screen()->add_help_tab( |
391 get_current_screen()->add_help_tab( |
374 'id' => 'discussion-settings', |
404 'id' => 'discussion-settings', |
375 'title' => __( 'Discussion Settings' ), |
405 'title' => __( 'Discussion Settings' ), |
376 'content' => $discussion_settings, |
406 'content' => $discussion_settings, |
377 ) |
407 ) |
378 ); |
408 ); |
379 } elseif ( 'page' == $post_type ) { |
409 } elseif ( 'page' === $post_type ) { |
380 $page_attributes = '<p>' . __( '<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' . |
410 $page_attributes = '<p>' . __( '<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' . |
381 '<p>' . __( '<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.' ) . '</p>' . |
411 '<p>' . __( '<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.' ) . '</p>' . |
382 '<p>' . __( '<strong>Order</strong> — Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>'; |
412 '<p>' . __( '<strong>Order</strong> — Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>'; |
383 |
413 |
384 get_current_screen()->add_help_tab( |
414 get_current_screen()->add_help_tab( |
506 |
536 |
507 // As of 4.4, the Get Shortlink button is hidden by default. |
537 // As of 4.4, the Get Shortlink button is hidden by default. |
508 if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { |
538 if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { |
509 $shortlink = wp_get_shortlink( $post->ID, 'post' ); |
539 $shortlink = wp_get_shortlink( $post->ID, 'post' ); |
510 |
540 |
511 if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) { |
541 if ( ! empty( $shortlink ) && $shortlink !== $permalink && home_url( '?page_id=' . $post->ID ) !== $permalink ) { |
512 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; |
542 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" />' . |
|
543 '<button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . |
|
544 __( 'Get Shortlink' ) . |
|
545 '</button>'; |
513 } |
546 } |
514 } |
547 } |
515 |
548 |
516 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
549 if ( $post_type_object->public |
517 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; |
550 && ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) |
|
551 ) { |
|
552 $has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status; |
518 ?> |
553 ?> |
519 <div id="edit-slug-box" class="hide-if-no-js"> |
554 <div id="edit-slug-box" class="hide-if-no-js"> |
520 <?php |
555 <?php |
521 if ( $has_sample_permalink ) { |
556 if ( $has_sample_permalink ) { |
522 echo $sample_permalink_html; |
557 echo $sample_permalink_html; |
568 ), |
603 ), |
569 ) |
604 ) |
570 ); |
605 ); |
571 ?> |
606 ?> |
572 <table id="post-status-info"><tbody><tr> |
607 <table id="post-status-info"><tbody><tr> |
573 <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> |
608 <td id="wp-word-count" class="hide-if-no-js"> |
|
609 <?php |
|
610 printf( |
|
611 /* translators: %s: Number of words. */ |
|
612 __( 'Word count: %s' ), |
|
613 '<span class="word-count">0</span>' |
|
614 ); |
|
615 ?> |
|
616 </td> |
574 <td class="autosave-info"> |
617 <td class="autosave-info"> |
575 <span class="autosave-message"> </span> |
618 <span class="autosave-message"> </span> |
576 <?php |
619 <?php |
577 if ( 'auto-draft' != $post->post_status ) { |
620 if ( 'auto-draft' !== $post->post_status ) { |
578 echo '<span id="last-edit">'; |
621 echo '<span id="last-edit">'; |
579 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) { |
622 $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ); |
580 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */ |
623 if ( $last_user ) { |
|
624 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time. */ |
581 printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); |
625 printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); |
582 } else { |
626 } else { |
583 /* translators: 1: Post edited date, 2: Post edited time */ |
627 /* translators: 1: Post edited date, 2: Post edited time. */ |
584 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); |
628 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); |
585 } |
629 } |
586 echo '</span>'; |
630 echo '</span>'; |
587 } |
631 } |
588 ?> |
632 ?> |