20 |
30 |
21 <div id="minor-publishing"> |
31 <div id="minor-publishing"> |
22 |
32 |
23 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
33 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
24 <div style="display:none;"> |
34 <div style="display:none;"> |
25 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?> |
35 <?php submit_button( __( 'Save' ), '', 'save' ); ?> |
26 </div> |
36 </div> |
27 |
37 |
28 <div id="minor-publishing-actions"> |
38 <div id="minor-publishing-actions"> |
29 <div id="save-action"> |
39 <div id="save-action"> |
30 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> |
40 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> |
31 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" /> |
41 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" /> |
|
42 <span class="spinner"></span> |
32 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> |
43 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> |
33 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" class="button" /> |
44 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" class="button" /> |
|
45 <span class="spinner"></span> |
34 <?php } ?> |
46 <?php } ?> |
35 <span class="spinner"></span> |
47 </div> |
36 </div> |
48 <?php if ( is_post_type_viewable( $post_type_object ) ) : ?> |
37 <?php if ( $post_type_object->public ) : ?> |
|
38 <div id="preview-action"> |
49 <div id="preview-action"> |
39 <?php |
50 <?php |
|
51 $preview_link = esc_url( get_preview_post_link( $post ) ); |
40 if ( 'publish' == $post->post_status ) { |
52 if ( 'publish' == $post->post_status ) { |
41 $preview_link = esc_url( get_permalink( $post->ID ) ); |
53 $preview_button_text = __( 'Preview Changes' ); |
42 $preview_button = __( 'Preview Changes' ); |
|
43 } else { |
54 } else { |
44 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
55 $preview_button_text = __( 'Preview' ); |
45 |
56 } |
46 /** |
57 |
47 * Filter the URI of a post preview in the post submit box. |
58 $preview_button = sprintf( '%1$s<span class="screen-reader-text"> %2$s</span>', |
48 * |
59 $preview_button_text, |
49 * @since 2.0.5 |
60 /* translators: accessibility text */ |
50 * @since 4.0.0 $post parameter was added. |
61 __( '(opens in a new window)' ) |
51 * |
62 ); |
52 * @param string $preview_link URI the user will be directed to for a post preview. |
|
53 * @param WP_Post $post Post object. |
|
54 */ |
|
55 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) ); |
|
56 $preview_button = __( 'Preview' ); |
|
57 } |
|
58 ?> |
63 ?> |
59 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a> |
64 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a> |
60 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
65 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
61 </div> |
66 </div> |
62 <?php endif; // public post type ?> |
67 <?php endif; // public post type ?> |
|
68 <?php |
|
69 /** |
|
70 * Fires before the post time/date setting in the Publish meta box. |
|
71 * |
|
72 * @since 4.4.0 |
|
73 * |
|
74 * @param WP_Post $post WP_Post object for the current post. |
|
75 */ |
|
76 do_action( 'post_submitbox_minor_actions', $post ); |
|
77 ?> |
63 <div class="clear"></div> |
78 <div class="clear"></div> |
64 </div><!-- #minor-publishing-actions --> |
79 </div><!-- #minor-publishing-actions --> |
65 |
80 |
66 <div id="misc-publishing-actions"> |
81 <div id="misc-publishing-actions"> |
67 |
82 |
68 <div class="misc-pub-section misc-pub-post-status"><label for="post_status"><?php _e('Status:') ?></label> |
83 <div class="misc-pub-section misc-pub-post-status"> |
69 <span id="post-status-display"> |
84 <?php _e( 'Status:' ) ?> <span id="post-status-display"><?php |
70 <?php |
85 |
71 switch ( $post->post_status ) { |
86 switch ( $post->post_status ) { |
72 case 'private': |
87 case 'private': |
73 _e('Privately Published'); |
88 _e('Privately Published'); |
74 break; |
89 break; |
75 case 'publish': |
90 case 'publish': |
87 break; |
102 break; |
88 } |
103 } |
89 ?> |
104 ?> |
90 </span> |
105 </span> |
91 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> |
106 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> |
92 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a> |
107 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a> |
93 |
108 |
94 <div id="post-status-select" class="hide-if-js"> |
109 <div id="post-status-select" class="hide-if-js"> |
95 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" /> |
110 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" /> |
96 <select name='post_status' id='post_status'> |
111 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ) ?></label> |
|
112 <select name="post_status" id="post_status"> |
97 <?php if ( 'publish' == $post->post_status ) : ?> |
113 <?php if ( 'publish' == $post->post_status ) : ?> |
98 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
114 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
99 <?php elseif ( 'private' == $post->post_status ) : ?> |
115 <?php elseif ( 'private' == $post->post_status ) : ?> |
100 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
116 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
101 <?php elseif ( 'future' == $post->post_status ) : ?> |
117 <?php elseif ( 'future' == $post->post_status ) : ?> |
146 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br /> |
162 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br /> |
147 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?> |
163 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?> |
148 <span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span> |
164 <span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span> |
149 <?php endif; ?> |
165 <?php endif; ?> |
150 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br /> |
166 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br /> |
151 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" maxlength="20" /><br /></span> |
167 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" maxlength="255" /><br /></span> |
152 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br /> |
168 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br /> |
153 |
169 |
154 <p> |
170 <p> |
155 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> |
171 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> |
156 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a> |
172 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a> |
159 <?php } ?> |
175 <?php } ?> |
160 |
176 |
161 </div><!-- .misc-pub-section --> |
177 </div><!-- .misc-pub-section --> |
162 |
178 |
163 <?php |
179 <?php |
164 /* translators: Publish box date format, see http://php.net/date */ |
180 /* translators: Publish box date format, see https://secure.php.net/date */ |
165 $datef = __( 'M j, Y @ H:i' ); |
181 $datef = __( 'M j, Y @ H:i' ); |
166 if ( 0 != $post->ID ) { |
182 if ( 0 != $post->ID ) { |
167 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date |
183 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date |
|
184 /* translators: Post date information. 1: Date on which the post is currently scheduled to be published */ |
168 $stamp = __('Scheduled for: <b>%1$s</b>'); |
185 $stamp = __('Scheduled for: <b>%1$s</b>'); |
169 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published |
186 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published |
|
187 /* translators: Post date information. 1: Date on which the post was published */ |
170 $stamp = __('Published on: <b>%1$s</b>'); |
188 $stamp = __('Published on: <b>%1$s</b>'); |
171 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified |
189 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified |
172 $stamp = __('Publish <b>immediately</b>'); |
190 $stamp = __('Publish <b>immediately</b>'); |
173 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified |
191 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified |
|
192 /* translators: Post date information. 1: Date on which the post is to be published */ |
174 $stamp = __('Schedule for: <b>%1$s</b>'); |
193 $stamp = __('Schedule for: <b>%1$s</b>'); |
175 } else { // draft, 1 or more saves, date specified |
194 } else { // draft, 1 or more saves, date specified |
|
195 /* translators: Post date information. 1: Date on which the post is to be published */ |
176 $stamp = __('Publish on: <b>%1$s</b>'); |
196 $stamp = __('Publish on: <b>%1$s</b>'); |
177 } |
197 } |
178 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
198 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
179 } else { // draft (no saves, and thus no date specified) |
199 } else { // draft (no saves, and thus no date specified) |
180 $stamp = __('Publish <b>immediately</b>'); |
200 $stamp = __('Publish <b>immediately</b>'); |
181 $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); |
201 $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); |
182 } |
202 } |
183 |
203 |
184 if ( ! empty( $args['args']['revisions_count'] ) ) : |
204 if ( ! empty( $args['args']['revisions_count'] ) ) : ?> |
185 $revisions_to_keep = wp_revisions_to_keep( $post ); |
|
186 ?> |
|
187 <div class="misc-pub-section misc-pub-revisions"> |
205 <div class="misc-pub-section misc-pub-revisions"> |
188 <?php |
206 <?php |
189 if ( $revisions_to_keep > 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) { |
207 /* translators: Post revisions heading. 1: The number of available revisions */ |
190 echo '<span title="' . esc_attr( sprintf( __( 'Your site is configured to keep only the last %s revisions.' ), |
|
191 number_format_i18n( $revisions_to_keep ) ) ) . '">'; |
|
192 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '+</b>' ); |
|
193 echo '</span>'; |
|
194 } else { |
|
195 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); |
208 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); |
196 } |
209 ?> |
197 ?> |
|
198 <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a> |
210 <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a> |
199 </div> |
211 </div> |
200 <?php endif; |
212 <?php endif; |
201 |
213 |
202 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> |
214 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> |
203 <div class="misc-pub-section curtime misc-pub-curtime"> |
215 <div class="misc-pub-section curtime misc-pub-curtime"> |
204 <span id="timestamp"> |
216 <span id="timestamp"> |
205 <?php printf($stamp, $date); ?></span> |
217 <?php printf($stamp, $date); ?></span> |
206 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> |
218 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> |
207 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div> |
219 <fieldset id="timestampdiv" class="hide-if-js"> |
|
220 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend> |
|
221 <?php touch_time( ( $action === 'edit' ), 1 ); ?> |
|
222 </fieldset> |
208 </div><?php // /misc-pub-section ?> |
223 </div><?php // /misc-pub-section ?> |
209 <?php endif; ?> |
224 <?php endif; ?> |
210 |
225 |
|
226 <?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?> |
|
227 <div class="notice notice-info notice-alt inline"> |
|
228 <p> |
|
229 <?php |
|
230 echo sprintf( |
|
231 /* translators: %s: URL to the Customizer */ |
|
232 __( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there’s no need to publish now. It will be published automatically with those changes.' ), |
|
233 esc_url( |
|
234 add_query_arg( |
|
235 'changeset_uuid', |
|
236 rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ), |
|
237 admin_url( 'customize.php' ) |
|
238 ) |
|
239 ) |
|
240 ); |
|
241 ?> |
|
242 </p> |
|
243 </div> |
|
244 <?php endif; ?> |
|
245 |
211 <?php |
246 <?php |
212 /** |
247 /** |
213 * Fires after the post time/date setting in the Publish meta box. |
248 * Fires after the post time/date setting in the Publish meta box. |
214 * |
249 * |
215 * @since 2.9.0 |
250 * @since 2.9.0 |
216 */ |
251 * @since 4.4.0 Added the `$post` parameter. |
217 do_action( 'post_submitbox_misc_actions' ); |
252 * |
|
253 * @param WP_Post $post WP_Post object for the current post. |
|
254 */ |
|
255 do_action( 'post_submitbox_misc_actions', $post ); |
218 ?> |
256 ?> |
219 </div> |
257 </div> |
220 <div class="clear"></div> |
258 <div class="clear"></div> |
221 </div> |
259 </div> |
222 |
260 |
245 <span class="spinner"></span> |
287 <span class="spinner"></span> |
246 <?php |
288 <?php |
247 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
289 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { |
248 if ( $can_publish ) : |
290 if ( $can_publish ) : |
249 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
291 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> |
250 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> |
292 <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> |
251 <?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false ); ?> |
293 <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> |
252 <?php else : ?> |
294 <?php else : ?> |
253 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
295 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" /> |
254 <?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false ); ?> |
296 <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> |
255 <?php endif; |
297 <?php endif; |
256 else : ?> |
298 else : ?> |
257 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
299 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> |
258 <?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false ); ?> |
300 <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?> |
259 <?php |
301 <?php |
260 endif; |
302 endif; |
261 } else { ?> |
303 } else { ?> |
262 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
304 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
263 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> |
305 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> |
284 |
326 |
285 <div id="minor-publishing"> |
327 <div id="minor-publishing"> |
286 |
328 |
287 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
329 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> |
288 <div style="display:none;"> |
330 <div style="display:none;"> |
289 <?php submit_button( __( 'Save' ), 'button', 'save' ); ?> |
331 <?php submit_button( __( 'Save' ), '', 'save' ); ?> |
290 </div> |
332 </div> |
291 |
333 |
292 |
334 |
293 <div id="misc-publishing-actions"> |
335 <div id="misc-publishing-actions"> |
294 <?php |
|
295 /* translators: Publish box date format, see http://php.net/date */ |
|
296 $datef = __( 'M j, Y @ H:i' ); |
|
297 $stamp = __('Uploaded on: <b>%1$s</b>'); |
|
298 $date = date_i18n( $datef, strtotime( $post->post_date ) ); |
|
299 ?> |
|
300 <div class="misc-pub-section curtime misc-pub-curtime"> |
336 <div class="misc-pub-section curtime misc-pub-curtime"> |
301 <span id="timestamp"><?php printf($stamp, $date); ?></span> |
337 <span id="timestamp"><?php |
|
338 $date = date_i18n( |
|
339 /* translators: Publish box date format, see https://secure.php.net/date */ |
|
340 __( 'M j, Y @ H:i' ), |
|
341 strtotime( $post->post_date ) |
|
342 ); |
|
343 printf( |
|
344 /* translators: Attachment information. %s: Date the attachment was uploaded */ |
|
345 __( 'Uploaded on: %s' ), |
|
346 '<b>' . $date . '</b>' |
|
347 ); |
|
348 ?></span> |
302 </div><!-- .misc-pub-section --> |
349 </div><!-- .misc-pub-section --> |
303 |
350 |
304 <?php |
351 <?php |
305 /** |
352 /** |
306 * Fires after the 'Uploaded on' section of the Save meta box |
353 * Fires after the 'Uploaded on' section of the Save meta box |
307 * in the attachment editing screen. |
354 * in the attachment editing screen. |
308 * |
355 * |
309 * @since 3.5.0 |
356 * @since 3.5.0 |
|
357 * @since 4.9.0 Added the `$post` parameter. |
|
358 * |
|
359 * @param WP_Post $post WP_Post object for the current attachment. |
310 */ |
360 */ |
311 do_action( 'attachment_submitbox_misc_actions' ); |
361 do_action( 'attachment_submitbox_misc_actions', $post ); |
312 ?> |
362 ?> |
313 </div><!-- #misc-publishing-actions --> |
363 </div><!-- #misc-publishing-actions --> |
314 <div class="clear"></div> |
364 <div class="clear"></div> |
315 </div><!-- #minor-publishing --> |
365 </div><!-- #minor-publishing --> |
316 |
366 |
317 <div id="major-publishing-actions"> |
367 <div id="major-publishing-actions"> |
318 <div id="delete-action"> |
368 <div id="delete-action"> |
319 <?php |
369 <?php |
320 if ( current_user_can( 'delete_post', $post->ID ) ) |
370 if ( current_user_can( 'delete_post', $post->ID ) ) |
321 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { |
371 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { |
322 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>"; |
372 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>"; |
323 } else { |
373 } else { |
324 $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; |
374 $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; |
325 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; |
375 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; |
326 } |
376 } |
327 ?> |
377 ?> |
328 </div> |
378 </div> |
329 |
379 |
330 <div id="publishing-action"> |
380 <div id="publishing-action"> |
331 <span class="spinner"></span> |
381 <span class="spinner"></span> |
332 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
382 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> |
333 <input name="save" type="submit" class="button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> |
383 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> |
334 </div> |
384 </div> |
335 <div class="clear"></div> |
385 <div class="clear"></div> |
336 </div><!-- #major-publishing-actions --> |
386 </div><!-- #major-publishing-actions --> |
337 |
387 |
338 </div> |
388 </div> |
366 // Add in the current one if it isn't there yet, in case the current theme doesn't support it |
416 // Add in the current one if it isn't there yet, in case the current theme doesn't support it |
367 if ( $post_format && !in_array( $post_format, $post_formats[0] ) ) |
417 if ( $post_format && !in_array( $post_format, $post_formats[0] ) ) |
368 $post_formats[0][] = $post_format; |
418 $post_formats[0][] = $post_format; |
369 ?> |
419 ?> |
370 <div id="post-formats-select"> |
420 <div id="post-formats-select"> |
371 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> |
421 <fieldset> |
372 <?php foreach ( $post_formats[0] as $format ) : ?> |
422 <legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend> |
373 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> |
423 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> |
374 <?php endforeach; ?><br /> |
424 <?php foreach ( $post_formats[0] as $format ) : ?> |
|
425 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> |
|
426 <?php endforeach; ?> |
|
427 </fieldset> |
375 </div> |
428 </div> |
376 <?php endif; endif; |
429 <?php endif; endif; |
377 } |
430 } |
378 |
431 |
379 /** |
432 /** |
407 $r = wp_parse_args( $args, $defaults ); |
460 $r = wp_parse_args( $args, $defaults ); |
408 $tax_name = esc_attr( $r['taxonomy'] ); |
461 $tax_name = esc_attr( $r['taxonomy'] ); |
409 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
462 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
410 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); |
463 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); |
411 $comma = _x( ',', 'tag delimiter' ); |
464 $comma = _x( ',', 'tag delimiter' ); |
|
465 $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name ); |
|
466 if ( ! is_string( $terms_to_edit ) ) { |
|
467 $terms_to_edit = ''; |
|
468 } |
412 ?> |
469 ?> |
413 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
470 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
414 <div class="jaxtag"> |
471 <div class="jaxtag"> |
415 <div class="nojs-tags hide-if-js"> |
472 <div class="nojs-tags hide-if-js"> |
416 <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p> |
473 <label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label> |
417 <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div> |
474 <p><textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p> |
|
475 </div> |
418 <?php if ( $user_can_assign_terms ) : ?> |
476 <?php if ( $user_can_assign_terms ) : ?> |
419 <div class="ajaxtag hide-if-no-js"> |
477 <div class="ajaxtag hide-if-no-js"> |
420 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label> |
478 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
421 <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" /> |
479 <p><input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" /> |
422 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p> |
480 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p> |
423 </div> |
481 </div> |
424 <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> |
482 <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> |
|
483 <?php elseif ( empty( $terms_to_edit ) ): ?> |
|
484 <p><?php echo $taxonomy->labels->no_terms; ?></p> |
425 <?php endif; ?> |
485 <?php endif; ?> |
426 </div> |
486 </div> |
427 <div class="tagchecklist"></div> |
487 <ul class="tagchecklist" role="list"></ul> |
428 </div> |
488 </div> |
429 <?php if ( $user_can_assign_terms ) : ?> |
489 <?php if ( $user_can_assign_terms ) : ?> |
430 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p> |
490 <p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php echo $tax_name; ?>" aria-expanded="false"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p> |
431 <?php endif; ?> |
491 <?php endif; ?> |
432 <?php |
492 <?php |
433 } |
493 } |
434 |
494 |
435 /** |
495 /** |
465 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
525 $taxonomy = get_taxonomy( $r['taxonomy'] ); |
466 ?> |
526 ?> |
467 <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> |
527 <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> |
468 <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs"> |
528 <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs"> |
469 <li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li> |
529 <li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li> |
470 <li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php _e( 'Most Used' ); ?></a></li> |
530 <li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php echo esc_html( $taxonomy->labels->most_used ); ?></a></li> |
471 </ul> |
531 </ul> |
472 |
532 |
473 <div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;"> |
533 <div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;"> |
474 <ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" > |
534 <ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" > |
475 <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?> |
535 <?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?> |
476 </ul> |
536 </ul> |
477 </div> |
537 </div> |
478 |
538 |
479 <div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> |
539 <div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> |
480 <?php |
540 <?php |
481 $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
541 $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
482 echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
542 echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. |
483 ?> |
543 ?> |
484 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> |
544 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> |
485 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?> |
545 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?> |
486 </ul> |
546 </ul> |
487 </div> |
547 </div> |
488 <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
548 <?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
489 <div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children"> |
549 <div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children"> |
490 <h4> |
550 <a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
491 <a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js"> |
551 <?php |
492 <?php |
552 /* translators: %s: add new taxonomy label */ |
493 /* translators: %s: add new taxonomy label */ |
553 printf( __( '+ %s' ), $taxonomy->labels->add_new_item ); |
494 printf( __( '+ %s' ), $taxonomy->labels->add_new_item ); |
554 ?> |
495 ?> |
555 </a> |
496 </a> |
|
497 </h4> |
|
498 <p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child"> |
556 <p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child"> |
499 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
557 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
500 <input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
558 <input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
501 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent"> |
559 <label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent"> |
502 <?php echo $taxonomy->labels->parent_item_colon; ?> |
560 <?php echo $taxonomy->labels->parent_item_colon; ?> |
503 </label> |
561 </label> |
504 <?php wp_dropdown_categories( array( 'taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —' ) ); ?> |
562 <?php |
|
563 $parent_dropdown_args = array( |
|
564 'taxonomy' => $tax_name, |
|
565 'hide_empty' => 0, |
|
566 'name' => 'new' . $tax_name . '_parent', |
|
567 'orderby' => 'name', |
|
568 'hierarchical' => 1, |
|
569 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
|
570 ); |
|
571 |
|
572 /** |
|
573 * Filters the arguments for the taxonomy parent dropdown on the Post Edit page. |
|
574 * |
|
575 * @since 4.4.0 |
|
576 * |
|
577 * @param array $parent_dropdown_args { |
|
578 * Optional. Array of arguments to generate parent dropdown. |
|
579 * |
|
580 * @type string $taxonomy Name of the taxonomy to retrieve. |
|
581 * @type bool $hide_if_empty True to skip generating markup if no |
|
582 * categories are found. Default 0. |
|
583 * @type string $name Value for the 'name' attribute |
|
584 * of the select element. |
|
585 * Default "new{$tax_name}_parent". |
|
586 * @type string $orderby Which column to use for ordering |
|
587 * terms. Default 'name'. |
|
588 * @type bool|int $hierarchical Whether to traverse the taxonomy |
|
589 * hierarchy. Default 1. |
|
590 * @type string $show_option_none Text to display for the "none" option. |
|
591 * Default "— {$parent} —", |
|
592 * where `$parent` is 'parent_item' |
|
593 * taxonomy label. |
|
594 * } |
|
595 */ |
|
596 $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
|
597 |
|
598 wp_dropdown_categories( $parent_dropdown_args ); |
|
599 ?> |
505 <input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
600 <input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
506 <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
601 <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
507 <span id="<?php echo $tax_name; ?>-ajax-response"></span> |
602 <span id="<?php echo $tax_name; ?>-ajax-response"></span> |
508 </p> |
603 </p> |
509 </div> |
604 </div> |
532 * @since 2.6.0 |
633 * @since 2.6.0 |
533 * |
634 * |
534 * @param object $post |
635 * @param object $post |
535 */ |
636 */ |
536 function post_trackback_meta_box($post) { |
637 function post_trackback_meta_box($post) { |
537 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />'; |
638 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' . |
|
639 esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />'; |
538 if ('' != $post->pinged) { |
640 if ('' != $post->pinged) { |
539 $pings = '<p>'. __('Already pinged:') . '</p><ul>'; |
641 $pings = '<p>'. __('Already pinged:') . '</p><ul>'; |
540 $already_pinged = explode("\n", trim($post->pinged)); |
642 $already_pinged = explode("\n", trim($post->pinged)); |
541 foreach ($already_pinged as $pinged_url) { |
643 foreach ($already_pinged as $pinged_url) { |
542 $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>"; |
644 $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>"; |
543 } |
645 } |
544 $pings .= '</ul>'; |
646 $pings .= '</ul>'; |
545 } |
647 } |
546 |
648 |
547 ?> |
649 ?> |
548 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p> |
650 <p> |
549 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using <a href="https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p> |
651 <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label> |
|
652 <?php echo $form_trackback; ?> |
|
653 </p> |
|
654 <p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p> |
|
655 <p><?php |
|
656 printf( |
|
657 /* translators: %s: Codex URL */ |
|
658 __( 'Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ), |
|
659 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) |
|
660 ); |
|
661 ?></p> |
550 <?php |
662 <?php |
551 if ( ! empty($pings) ) |
663 if ( ! empty($pings) ) |
552 echo $pings; |
664 echo $pings; |
553 } |
665 } |
554 |
666 |
717 'sort_column' => 'menu_order, post_title', |
843 'sort_column' => 'menu_order, post_title', |
718 'echo' => 0, |
844 'echo' => 0, |
719 ); |
845 ); |
720 |
846 |
721 /** |
847 /** |
722 * Filter the arguments used to generate a Pages drop-down element. |
848 * Filters the arguments used to generate a Pages drop-down element. |
723 * |
849 * |
724 * @since 3.3.0 |
850 * @since 3.3.0 |
725 * |
851 * |
726 * @see wp_dropdown_pages() |
852 * @see wp_dropdown_pages() |
727 * |
853 * |
728 * @param array $dropdown_args Array of arguments used to generate the pages drop-down. |
854 * @param array $dropdown_args Array of arguments used to generate the pages drop-down. |
729 * @param WP_Post $post The current WP_Post object. |
855 * @param WP_Post $post The current post. |
730 */ |
856 */ |
731 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
857 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
732 $pages = wp_dropdown_pages( $dropdown_args ); |
858 $pages = wp_dropdown_pages( $dropdown_args ); |
733 if ( ! empty($pages) ) { |
859 if ( ! empty($pages) ) : |
734 ?> |
860 ?> |
735 <p><strong><?php _e('Parent') ?></strong></p> |
861 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> |
736 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label> |
|
737 <?php echo $pages; ?> |
862 <?php echo $pages; ?> |
738 <?php |
863 <?php |
739 } // end empty pages check |
864 endif; // end empty pages check |
740 } // end hierarchical check. |
865 endif; // end hierarchical check. |
741 if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) { |
866 |
742 $template = !empty($post->page_template) ? $post->page_template : false; |
867 if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) : |
|
868 $template = ! empty( $post->page_template ) ? $post->page_template : false; |
743 ?> |
869 ?> |
744 <p><strong><?php _e('Template') ?></strong></p> |
870 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label><?php |
745 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template"> |
871 /** |
746 <?php |
872 * Fires immediately after the label inside the 'Template' section |
747 /** |
873 * of the 'Page Attributes' meta box. |
748 * Filter the title of the default page template displayed in the drop-down. |
874 * |
|
875 * @since 4.4.0 |
|
876 * |
|
877 * @param string $template The template used for the current post. |
|
878 * @param WP_Post $post The current post. |
|
879 */ |
|
880 do_action( 'page_attributes_meta_box_template', $template, $post ); |
|
881 ?></p> |
|
882 <select name="page_template" id="page_template"> |
|
883 <?php |
|
884 /** |
|
885 * Filters the title of the default page template displayed in the drop-down. |
749 * |
886 * |
750 * @since 4.1.0 |
887 * @since 4.1.0 |
751 * |
888 * |
752 * @param string $label The display value for the default page template title. |
889 * @param string $label The display value for the default page template title. |
753 * @param string $context Where the option label is displayed. Possible values |
890 * @param string $context Where the option label is displayed. Possible values |
754 * include 'meta-box' or 'quick-edit'. |
891 * include 'meta-box' or 'quick-edit'. |
755 */ |
892 */ |
756 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' ); |
893 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' ); |
757 ?> |
894 ?> |
758 <option value="default"><?php echo esc_html( $default_title ); ?></option> |
895 <option value="default"><?php echo esc_html( $default_title ); ?></option> |
759 <?php page_template_dropdown($template); ?> |
896 <?php page_template_dropdown( $template, $post->post_type ); ?> |
760 </select> |
897 </select> |
761 <?php |
898 <?php endif; ?> |
762 } ?> |
899 <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?> |
763 <p><strong><?php _e('Order') ?></strong></p> |
900 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p> |
764 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> |
901 <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" /> |
765 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) { ?> |
902 <?php |
766 <p><?php _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p> |
903 /** |
767 <?php |
904 * Fires before the help hint text in the 'Page Attributes' meta box. |
768 } |
905 * |
|
906 * @since 4.9.0 |
|
907 * |
|
908 * @param WP_Post $post The current post. |
|
909 */ |
|
910 do_action( 'page_attributes_misc_attributes', $post ); |
|
911 ?> |
|
912 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?> |
|
913 <p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> |
|
914 <?php endif; |
|
915 endif; |
769 } |
916 } |
770 |
917 |
771 // -- Link related Meta Boxes |
918 // -- Link related Meta Boxes |
772 |
919 |
773 /** |
920 /** |
806 </div> |
953 </div> |
807 |
954 |
808 <div id="major-publishing-actions"> |
955 <div id="major-publishing-actions"> |
809 <?php |
956 <?php |
810 /** This action is documented in wp-admin/includes/meta-boxes.php */ |
957 /** This action is documented in wp-admin/includes/meta-boxes.php */ |
811 do_action( 'post_submitbox_start' ); |
958 do_action( 'post_submitbox_start', null ); |
812 ?> |
959 ?> |
813 <div id="delete-action"> |
960 <div id="delete-action"> |
814 <?php |
961 <?php |
815 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> |
962 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> |
816 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> |
963 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a> |
817 <?php } ?> |
964 <?php } ?> |
818 </div> |
965 </div> |
819 |
966 |
820 <div id="publishing-action"> |
967 <div id="publishing-action"> |
821 <?php if ( !empty($link->link_id) ) { ?> |
968 <?php if ( !empty($link->link_id) ) { ?> |
822 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" /> |
969 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" /> |
823 <?php } else { ?> |
970 <?php } else { ?> |
824 <input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" /> |
971 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" /> |
825 <?php } ?> |
972 <?php } ?> |
826 </div> |
973 </div> |
827 <div class="clear"></div> |
974 <div class="clear"></div> |
828 </div> |
975 </div> |
829 <?php |
976 <?php |
911 /** |
1058 /** |
912 * Display checked checkboxes attribute for xfn microformat options. |
1059 * Display checked checkboxes attribute for xfn microformat options. |
913 * |
1060 * |
914 * @since 1.0.1 |
1061 * @since 1.0.1 |
915 * |
1062 * |
|
1063 * @global object $link |
|
1064 * |
916 * @param string $class |
1065 * @param string $class |
917 * @param string $value |
1066 * @param string $value |
918 * @param mixed $deprecated Never used. |
1067 * @param mixed $deprecated Never used. |
919 */ |
1068 */ |
920 function xfn_check( $class, $value = '', $deprecated = '' ) { |
1069 function xfn_check( $class, $value = '', $deprecated = '' ) { |
921 global $link; |
1070 global $link; |
922 |
1071 |
923 if ( !empty( $deprecated ) ) |
1072 if ( ! empty( $deprecated ) ) { |
924 _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented |
1073 _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented |
|
1074 } |
925 |
1075 |
926 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; |
1076 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; |
927 $rels = preg_split('/\s+/', $link_rel); |
1077 $rels = preg_split('/\s+/', $link_rel); |
928 |
1078 |
929 if ('' != $value && in_array($value, $rels) ) { |
1079 if ('' != $value && in_array($value, $rels) ) { |