8 |
8 |
9 // don't load directly |
9 // don't load directly |
10 if ( !defined('ABSPATH') ) |
10 if ( !defined('ABSPATH') ) |
11 die('-1'); |
11 die('-1'); |
12 |
12 |
|
13 /** |
|
14 * @global string $post_type |
|
15 * @global WP_Post_Type $post_type_object |
|
16 * @global WP_Post $post |
|
17 */ |
13 global $post_type, $post_type_object, $post; |
18 global $post_type, $post_type_object, $post; |
|
19 |
|
20 if ( is_multisite() ) { |
|
21 add_action( 'admin_footer', '_admin_notice_post_locked' ); |
|
22 } else { |
|
23 $check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) ); |
|
24 |
|
25 if ( count( $check_users ) > 1 ) |
|
26 add_action( 'admin_footer', '_admin_notice_post_locked' ); |
|
27 |
|
28 unset( $check_users ); |
|
29 } |
14 |
30 |
15 wp_enqueue_script('post'); |
31 wp_enqueue_script('post'); |
16 $_wp_editor_expand = $_content_editor_dfw = false; |
32 $_wp_editor_expand = $_content_editor_dfw = false; |
17 |
33 |
18 /** |
34 /** |
19 * Filter whether to enable the 'expand' functionality in the post editor. |
35 * Filters whether to enable the 'expand' functionality in the post editor. |
20 * |
36 * |
21 * @since 4.0.0 |
37 * @since 4.0.0 |
22 * @since 4.1.0 Added the `$post_type` parameter. |
38 * @since 4.1.0 Added the `$post_type` parameter. |
23 * |
39 * |
24 * @param bool $expand Whether to enable the 'expand' functionality. Default true. |
40 * @param bool $expand Whether to enable the 'expand' functionality. Default true. |
74 if ( ! $permalink ) { |
90 if ( ! $permalink ) { |
75 $permalink = ''; |
91 $permalink = ''; |
76 } |
92 } |
77 |
93 |
78 $messages = array(); |
94 $messages = array(); |
|
95 |
|
96 $preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = ''; |
|
97 $preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = ''; |
|
98 |
|
99 $preview_url = get_preview_post_link( $post ); |
|
100 |
|
101 $viewable = is_post_type_viewable( $post_type_object ); |
|
102 |
|
103 if ( $viewable ) { |
|
104 |
|
105 // Preview post link. |
|
106 $preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', |
|
107 esc_url( $preview_url ), |
|
108 __( 'Preview post' ) |
|
109 ); |
|
110 |
|
111 // Scheduled post preview link. |
|
112 $scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', |
|
113 esc_url( $permalink ), |
|
114 __( 'Preview post' ) |
|
115 ); |
|
116 |
|
117 // View post link. |
|
118 $view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>', |
|
119 esc_url( $permalink ), |
|
120 __( 'View post' ) |
|
121 ); |
|
122 |
|
123 // Preview page link. |
|
124 $preview_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', |
|
125 esc_url( $preview_url ), |
|
126 __( 'Preview page' ) |
|
127 ); |
|
128 |
|
129 // Scheduled page preview link. |
|
130 $scheduled_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>', |
|
131 esc_url( $permalink ), |
|
132 __( 'Preview page' ) |
|
133 ); |
|
134 |
|
135 // View page link. |
|
136 $view_page_link_html = sprintf( ' <a href="%1$s">%2$s</a>', |
|
137 esc_url( $permalink ), |
|
138 __( 'View page' ) |
|
139 ); |
|
140 |
|
141 } |
|
142 |
|
143 /* translators: Publish box date format, see https://secure.php.net/date */ |
|
144 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ); |
|
145 |
79 $messages['post'] = array( |
146 $messages['post'] = array( |
80 0 => '', // Unused. Messages start at index 1. |
147 0 => '', // Unused. Messages start at index 1. |
81 1 => sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( $permalink ) ), |
148 1 => __( 'Post updated.' ) . $view_post_link_html, |
82 2 => __('Custom field updated.'), |
149 2 => __( 'Custom field updated.' ), |
83 3 => __('Custom field deleted.'), |
150 3 => __( 'Custom field deleted.' ), |
84 4 => __('Post updated.'), |
151 4 => __( 'Post updated.' ), |
85 /* translators: %s: date and time of the revision */ |
152 /* translators: %s: date and time of the revision */ |
86 5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
153 5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
87 6 => sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( $permalink ) ), |
154 6 => __( 'Post published.' ) . $view_post_link_html, |
88 7 => __('Post saved.'), |
155 7 => __( 'Post saved.' ), |
89 8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), |
156 8 => __( 'Post submitted.' ) . $preview_post_link_html, |
90 9 => sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'), |
157 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html, |
91 /* translators: Publish box date format, see http://php.net/date */ |
158 10 => __( 'Post draft updated.' ) . $preview_post_link_html, |
92 date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ), |
|
93 10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), |
|
94 ); |
159 ); |
95 $messages['page'] = array( |
160 $messages['page'] = array( |
96 0 => '', // Unused. Messages start at index 1. |
161 0 => '', // Unused. Messages start at index 1. |
97 1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( $permalink ) ), |
162 1 => __( 'Page updated.' ) . $view_page_link_html, |
98 2 => __('Custom field updated.'), |
163 2 => __( 'Custom field updated.' ), |
99 3 => __('Custom field deleted.'), |
164 3 => __( 'Custom field deleted.' ), |
100 4 => __('Page updated.'), |
165 4 => __( 'Page updated.' ), |
101 5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
166 /* translators: %s: date and time of the revision */ |
102 6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( $permalink ) ), |
167 5 => isset($_GET['revision']) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
103 7 => __('Page saved.'), |
168 6 => __( 'Page published.' ) . $view_page_link_html, |
104 8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), |
169 7 => __( 'Page saved.' ), |
105 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 ) ), |
170 8 => __( 'Page submitted.' ) . $preview_page_link_html, |
106 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), |
171 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html, |
|
172 10 => __( 'Page draft updated.' ) . $preview_page_link_html, |
107 ); |
173 ); |
108 $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now. |
174 $messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now. |
109 |
175 |
110 /** |
176 /** |
111 * Filter the post updated messages. |
177 * Filters the post updated messages. |
112 * |
178 * |
113 * @since 3.0.0 |
179 * @since 3.0.0 |
114 * |
180 * |
115 * @param array $messages Post updated messages. For defaults @see $messages declarations above. |
181 * @param array $messages Post updated messages. For defaults @see $messages declarations above. |
116 */ |
182 */ |
202 $tax_meta_box_id = $tax_name . 'div'; |
268 $tax_meta_box_id = $tax_name . 'div'; |
203 |
269 |
204 add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); |
270 add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); |
205 } |
271 } |
206 |
272 |
207 if ( post_type_supports($post_type, 'page-attributes') ) |
273 if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) { |
208 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); |
274 add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' ); |
|
275 } |
209 |
276 |
210 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) |
277 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) |
211 add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low'); |
278 add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low'); |
212 |
279 |
213 if ( post_type_supports($post_type, 'excerpt') ) |
280 if ( post_type_supports($post_type, 'excerpt') ) |
214 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core'); |
281 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core'); |
215 |
282 |
216 if ( post_type_supports($post_type, 'trackbacks') ) |
283 if ( post_type_supports($post_type, 'trackbacks') ) |
227 * |
294 * |
228 * @param WP_Post $post Post object. |
295 * @param WP_Post $post Post object. |
229 */ |
296 */ |
230 do_action( 'dbx_post_advanced', $post ); |
297 do_action( 'dbx_post_advanced', $post ); |
231 |
298 |
232 if ( post_type_supports($post_type, 'comments') ) |
299 // Allow the Discussion meta box to show up if the post type supports comments, |
233 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core'); |
300 // or if comments or pings are open. |
234 |
301 if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
235 if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) |
302 add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' ); |
236 add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); |
303 } |
|
304 |
|
305 $stati = get_post_stati( array( 'public' => true ) ); |
|
306 if ( empty( $stati ) ) { |
|
307 $stati = array( 'publish' ); |
|
308 } |
|
309 $stati[] = 'private'; |
|
310 |
|
311 if ( in_array( get_post_status( $post ), $stati ) ) { |
|
312 // If the post type support comments, or the post has comments, allow the |
|
313 // Comments meta box. |
|
314 if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { |
|
315 add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' ); |
|
316 } |
|
317 } |
237 |
318 |
238 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) |
319 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) |
239 add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); |
320 add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); |
240 |
321 |
241 if ( post_type_supports($post_type, 'author') ) { |
322 if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) { |
242 if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) |
323 add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' ); |
243 add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); |
|
244 } |
324 } |
245 |
325 |
246 /** |
326 /** |
247 * Fires after all built-in meta boxes have been added. |
327 * Fires after all built-in meta boxes have been added. |
248 * |
328 * |
290 'id' => 'customize-display', |
370 'id' => 'customize-display', |
291 'title' => __('Customizing This Display'), |
371 'title' => __('Customizing This Display'), |
292 'content' => $customize_display, |
372 'content' => $customize_display, |
293 ) ); |
373 ) ); |
294 |
374 |
295 $title_and_editor = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>'; |
375 $title_and_editor = '<p>' . __('<strong>Title</strong> — Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>'; |
296 $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>'; |
376 $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>'; |
297 $title_and_editor .= '<p>' . __( 'Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. ') . '</p>'; |
377 $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>'; |
298 $title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Line breaks will be converted to paragraphs automatically.' ) . '</p>'; |
378 $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>'; |
299 $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the icons above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>'; |
379 $title_and_editor .= '<p>' . __( 'You can insert media files by clicking the icons above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>'; |
300 $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>'; |
380 $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>'; |
301 $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>'; |
381 $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>'; |
302 |
382 |
303 get_current_screen()->add_help_tab( array( |
383 get_current_screen()->add_help_tab( array( |
305 'title' => __('Title and Post Editor'), |
385 'title' => __('Title and Post Editor'), |
306 'content' => $title_and_editor, |
386 'content' => $title_and_editor, |
307 ) ); |
387 ) ); |
308 |
388 |
309 get_current_screen()->set_help_sidebar( |
389 get_current_screen()->set_help_sidebar( |
310 '<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' . |
390 '<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'tools.php') . '</p>' . |
311 '<p><strong>' . __('For more information:') . '</strong></p>' . |
391 '<p><strong>' . __('For more information:') . '</strong></p>' . |
312 '<p>' . __('<a href="https://codex.wordpress.org/Posts_Add_New_Screen" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' . |
392 '<p>' . __('<a href="https://codex.wordpress.org/Posts_Add_New_Screen">Documentation on Writing and Editing Posts</a>') . '</p>' . |
313 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
393 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
314 ); |
394 ); |
315 } elseif ( 'page' == $post_type ) { |
395 } elseif ( 'page' == $post_type ) { |
316 $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>' . |
396 $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>' . |
317 '<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>'; |
397 '<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>'; |
318 |
398 |
319 get_current_screen()->add_help_tab( array( |
399 get_current_screen()->add_help_tab( array( |
320 'id' => 'about-pages', |
400 'id' => 'about-pages', |
321 'title' => __('About Pages'), |
401 'title' => __('About Pages'), |
322 'content' => $about_pages, |
402 'content' => $about_pages, |
323 ) ); |
403 ) ); |
324 |
404 |
325 get_current_screen()->set_help_sidebar( |
405 get_current_screen()->set_help_sidebar( |
326 '<p><strong>' . __('For more information:') . '</strong></p>' . |
406 '<p><strong>' . __('For more information:') . '</strong></p>' . |
327 '<p>' . __('<a href="https://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' . |
407 '<p>' . __('<a href="https://codex.wordpress.org/Pages_Add_New_Screen">Documentation on Adding New Pages</a>') . '</p>' . |
328 '<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' . |
408 '<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages">Documentation on Editing Pages</a>') . '</p>' . |
329 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
409 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
330 ); |
410 ); |
331 } elseif ( 'attachment' == $post_type ) { |
411 } elseif ( 'attachment' == $post_type ) { |
332 get_current_screen()->add_help_tab( array( |
412 get_current_screen()->add_help_tab( array( |
333 'id' => 'overview', |
413 'id' => 'overview', |
334 'title' => __('Overview'), |
414 'title' => __('Overview'), |
357 ) ); |
437 ) ); |
358 } |
438 } |
359 |
439 |
360 if ( 'post' == $post_type ) { |
440 if ( 'post' == $post_type ) { |
361 $publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>'; |
441 $publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>'; |
362 $publish_box .= '<ul><li>' . __('<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). 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.') . '</li>'; |
442 $publish_box .= '<ul><li>' . |
|
443 __( '<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.' ) . |
|
444 '</li>'; |
363 |
445 |
364 if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) { |
446 if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) { |
365 $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>'; |
447 $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>'; |
366 } |
448 } |
367 |
449 |
368 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { |
450 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { |
369 $publish_box .= '<li>' . __('<strong>Featured Image</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 featured image as a post thumbnail on the home page, a custom header, etc.') . '</li>'; |
451 /* translators: %s: Featured Image */ |
|
452 $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>'; |
370 } |
453 } |
371 |
454 |
372 $publish_box .= '</ul>'; |
455 $publish_box .= '</ul>'; |
373 |
456 |
374 get_current_screen()->add_help_tab( array( |
457 get_current_screen()->add_help_tab( array( |
375 'id' => 'publish-box', |
458 'id' => 'publish-box', |
376 'title' => __('Publish Settings'), |
459 'title' => __('Publish Settings'), |
377 'content' => $publish_box, |
460 'content' => $publish_box, |
378 ) ); |
461 ) ); |
379 |
462 |
380 $discussion_settings = '<p>' . __('<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>'; |
463 $discussion_settings = '<p>' . __('<strong>Send Trackbacks</strong> — Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>'; |
381 $discussion_settings .= '<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>'; |
464 $discussion_settings .= '<p>' . __('<strong>Discussion</strong> — You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>'; |
382 |
465 |
383 get_current_screen()->add_help_tab( array( |
466 get_current_screen()->add_help_tab( array( |
384 'id' => 'discussion-settings', |
467 'id' => 'discussion-settings', |
385 'title' => __('Discussion Settings'), |
468 'title' => __('Discussion Settings'), |
386 'content' => $discussion_settings, |
469 'content' => $discussion_settings, |
387 ) ); |
470 ) ); |
388 } elseif ( 'page' == $post_type ) { |
471 } elseif ( 'page' == $post_type ) { |
389 $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>' . |
472 $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>' . |
390 '<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>' . |
473 '<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>' . |
391 '<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>'; |
474 '<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>'; |
392 |
475 |
393 get_current_screen()->add_help_tab( array( |
476 get_current_screen()->add_help_tab( array( |
394 'id' => 'page-attributes', |
477 'id' => 'page-attributes', |
395 'title' => __('Page Attributes'), |
478 'title' => __('Page Attributes'), |
396 'content' => $page_attributes, |
479 'content' => $page_attributes, |
540 'editor_height' => 300, |
637 'editor_height' => 300, |
541 'tinymce' => array( |
638 'tinymce' => array( |
542 'resize' => false, |
639 'resize' => false, |
543 'wp_autoresize_on' => $_wp_editor_expand, |
640 'wp_autoresize_on' => $_wp_editor_expand, |
544 'add_unload_trigger' => false, |
641 'add_unload_trigger' => false, |
|
642 'wp_keep_scroll_position' => ! $is_IE, |
545 ), |
643 ), |
546 ) ); ?> |
644 ) ); ?> |
547 <table id="post-status-info"><tbody><tr> |
645 <table id="post-status-info"><tbody><tr> |
548 <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> |
646 <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> |
549 <td class="autosave-info"> |
647 <td class="autosave-info"> |
550 <span class="autosave-message"> </span> |
648 <span class="autosave-message"> </span> |
551 <?php |
649 <?php |
552 if ( 'auto-draft' != $post->post_status ) { |
650 if ( 'auto-draft' != $post->post_status ) { |
553 echo '<span id="last-edit">'; |
651 echo '<span id="last-edit">'; |
554 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) { |
652 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) { |
555 printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); |
653 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */ |
|
654 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 ) ); |
556 } else { |
655 } else { |
557 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); |
656 /* translators: 1: Post edited date, 2: Post edited time */ |
|
657 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); |
558 } |
658 } |
559 echo '</span>'; |
659 echo '</span>'; |
560 } ?> |
660 } ?> |
561 </td> |
661 </td> |
562 <td id="content-resize-handle" class="hide-if-no-js"><br /></td> |
662 <td id="content-resize-handle" class="hide-if-no-js"><br /></td> |