Changeset 43571 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r43569 r43571 26 26 $post_type_object = get_post_type_object( $post_type ); 27 27 $can_publish = current_user_can( $post_type_object->cap->publish_posts ); 28 ?>28 ?> 29 29 <div class="submitbox" id="submitpost"> 30 30 31 31 <div id="minor-publishing"> 32 32 33 <?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 ?> 34 34 <div style="display:none;"> 35 <?php submit_button( __( 'Save' ), '', 'save' ); ?>35 <?php submit_button( __( 'Save' ), '', 'save' ); ?> 36 36 </div> 37 37 38 38 <div id="minor-publishing-actions"> 39 39 <div id="save-action"> 40 <?php41 if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {42 $private_style = '';43 if ( 'private' == $post->post_status ) {44 $private_style = 'style="display:none"';45 }46 ?>40 <?php 41 if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { 42 $private_style = ''; 43 if ( 'private' == $post->post_status ) { 44 $private_style = 'style="display:none"'; 45 } 46 ?> 47 47 <input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" /> 48 48 <span class="spinner"></span> … … 52 52 <?php } ?> 53 53 </div> 54 <?php if ( is_post_type_viewable( $post_type_object ) ) : ?>54 <?php if ( is_post_type_viewable( $post_type_object ) ) : ?> 55 55 <div id="preview-action"> 56 <?php57 $preview_link = esc_url( get_preview_post_link( $post ) );58 if ( 'publish' == $post->post_status ) {59 $preview_button_text = __( 'Preview Changes' );60 } else {61 $preview_button_text = __( 'Preview' );62 }63 64 $preview_button = sprintf(65 '%1$s<span class="screen-reader-text"> %2$s</span>',66 $preview_button_text,67 /* translators: accessibility text */68 __( '(opens in a new tab)' )69 );70 ?>56 <?php 57 $preview_link = esc_url( get_preview_post_link( $post ) ); 58 if ( 'publish' == $post->post_status ) { 59 $preview_button_text = __( 'Preview Changes' ); 60 } else { 61 $preview_button_text = __( 'Preview' ); 62 } 63 64 $preview_button = sprintf( 65 '%1$s<span class="screen-reader-text"> %2$s</span>', 66 $preview_button_text, 67 /* translators: accessibility text */ 68 __( '(opens in a new tab)' ) 69 ); 70 ?> 71 71 <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> 72 72 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> 73 73 </div> 74 74 <?php endif; // public post type ?> 75 <?php76 /**77 * Fires before the post time/date setting in the Publish meta box.78 *79 * @since 4.4.080 *81 * @param WP_Post $post WP_Post object for the current post.82 */83 do_action( 'post_submitbox_minor_actions', $post );84 ?>75 <?php 76 /** 77 * Fires before the post time/date setting in the Publish meta box. 78 * 79 * @since 4.4.0 80 * 81 * @param WP_Post $post WP_Post object for the current post. 82 */ 83 do_action( 'post_submitbox_minor_actions', $post ); 84 ?> 85 85 <div class="clear"></div> 86 86 </div><!-- #minor-publishing-actions --> … … 89 89 90 90 <div class="misc-pub-section misc-pub-post-status"> 91 <?php _e( 'Status:' ); ?> <span id="post-status-display">91 <?php _e( 'Status:' ); ?> <span id="post-status-display"> 92 92 <?php 93 93 … … 110 110 break; 111 111 } 112 ?>112 ?> 113 113 </span> 114 <?php115 if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {116 $private_style = '';117 if ( 'private' == $post->post_status ) {118 $private_style = 'style="display:none"';119 }120 ?>114 <?php 115 if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { 116 $private_style = ''; 117 if ( 'private' == $post->post_status ) { 118 $private_style = 'style="display:none"'; 119 } 120 ?> 121 121 <a href="#post_status" <?php echo $private_style; ?> 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> 122 122 … … 125 125 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label> 126 126 <select name="post_status" id="post_status"> 127 <?php if ( 'publish' == $post->post_status ) : ?>127 <?php if ( 'publish' == $post->post_status ) : ?> 128 128 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> 129 129 <?php elseif ( 'private' == $post->post_status ) : ?> … … 133 133 <?php endif; ?> 134 134 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option> 135 <?php if ( 'auto-draft' == $post->post_status ) : ?>135 <?php if ( 'auto-draft' == $post->post_status ) : ?> 136 136 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> 137 137 <?php else : ?> … … 147 147 148 148 <div class="misc-pub-section misc-pub-visibility" id="visibility"> 149 <?php _e( 'Visibility:' ); ?> <span id="post-visibility-display">149 <?php _e( 'Visibility:' ); ?> <span id="post-visibility-display"> 150 150 <?php 151 151 … … 166 166 167 167 echo esc_html( $visibility_trans ); 168 ?>168 ?> 169 169 </span> 170 <?php if ( $can_publish ) { ?>170 <?php if ( $can_publish ) { ?> 171 171 <a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a> 172 172 173 173 <div id="post-visibility-select" class="hide-if-js"> 174 174 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" /> 175 <?php if ( $post_type == 'post' ) : ?>175 <?php if ( $post_type == 'post' ) : ?> 176 176 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> 177 177 <?php endif; ?> 178 178 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" /> 179 179 <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 /> 180 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>180 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?> 181 181 <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> 182 182 <?php endif; ?> … … 194 194 </div><!-- .misc-pub-section --> 195 195 196 <?php 197 /* translators: Publish box date format, see https://secure.php.net/date */ 198 $datef = __( 'M j, Y @ H:i' ); 199 if ( 0 != $post->ID ) { 200 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 201 /* translators: Post date information. %s: Date on which the post is currently scheduled to be published */ 202 $stamp = __( 'Scheduled for: <b>%s</b>' ); 203 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 204 /* translators: Post date information. %s: Date on which the post was published */ 205 $stamp = __( 'Published on: <b>%s</b>' ); 206 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 196 <?php 197 /* translators: Publish box date format, see https://secure.php.net/date */ 198 $datef = __( 'M j, Y @ H:i' ); 199 if ( 0 != $post->ID ) { 200 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 201 /* translators: Post date information. %s: Date on which the post is currently scheduled to be published */ 202 $stamp = __( 'Scheduled for: <b>%s</b>' ); 203 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 204 /* translators: Post date information. %s: Date on which the post was published */ 205 $stamp = __( 'Published on: <b>%s</b>' ); 206 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 207 $stamp = __( 'Publish <b>immediately</b>' ); 208 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 209 /* translators: Post date information. %s: Date on which the post is to be published */ 210 $stamp = __( 'Schedule for: <b>%s</b>' ); 211 } else { // draft, 1 or more saves, date specified 212 /* translators: Post date information. %s: Date on which the post is to be published */ 213 $stamp = __( 'Publish on: <b>%s</b>' ); 214 } 215 $date = date_i18n( $datef, strtotime( $post->post_date ) ); 216 } else { // draft (no saves, and thus no date specified) 207 217 $stamp = __( 'Publish <b>immediately</b>' ); 208 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 209 /* translators: Post date information. %s: Date on which the post is to be published */ 210 $stamp = __( 'Schedule for: <b>%s</b>' ); 211 } else { // draft, 1 or more saves, date specified 212 /* translators: Post date information. %s: Date on which the post is to be published */ 213 $stamp = __( 'Publish on: <b>%s</b>' ); 214 } 215 $date = date_i18n( $datef, strtotime( $post->post_date ) ); 216 } else { // draft (no saves, and thus no date specified) 217 $stamp = __( 'Publish <b>immediately</b>' ); 218 $date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) ); 219 } 220 221 if ( ! empty( $args['args']['revisions_count'] ) ) : 222 ?> 218 $date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) ); 219 } 220 221 if ( ! empty( $args['args']['revisions_count'] ) ) : 222 ?> 223 223 <div class="misc-pub-section misc-pub-revisions"> 224 <?php224 <?php 225 225 /* translators: Post revisions heading. %s: The number of available revisions */ 226 226 printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); 227 ?>227 ?> 228 228 <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> 229 229 </div> 230 <?php230 <?php 231 231 endif; 232 232 233 if ( $can_publish ) : // Contributors don't get to choose the date of publish234 ?>233 if ( $can_publish ) : // Contributors don't get to choose the date of publish 234 ?> 235 235 <div class="misc-pub-section curtime misc-pub-curtime"> 236 236 <span id="timestamp"> 237 <?php printf( $stamp, $date ); ?></span>237 <?php printf( $stamp, $date ); ?></span> 238 238 <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> 239 239 <fieldset id="timestampdiv" class="hide-if-js"> 240 240 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend> 241 <?php touch_time( ( $action === 'edit' ), 1 ); ?>241 <?php touch_time( ( $action === 'edit' ), 1 ); ?> 242 242 </fieldset> 243 243 </div><?php // /misc-pub-section ?> 244 244 <?php endif; ?> 245 245 246 <?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?>246 <?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?> 247 247 <div class="notice notice-info notice-alt inline"> 248 248 <p> … … 262 262 </p> 263 263 </div> 264 <?php endif; ?>265 266 <?php267 /**268 * Fires after the post time/date setting in the Publish meta box.269 *270 * @since 2.9.0271 * @since 4.4.0 Added the `$post` parameter.272 *273 * @param WP_Post $post WP_Post object for the current post.274 */275 do_action( 'post_submitbox_misc_actions', $post );276 ?>264 <?php endif; ?> 265 266 <?php 267 /** 268 * Fires after the post time/date setting in the Publish meta box. 269 * 270 * @since 2.9.0 271 * @since 4.4.0 Added the `$post` parameter. 272 * 273 * @param WP_Post $post WP_Post object for the current post. 274 */ 275 do_action( 'post_submitbox_misc_actions', $post ); 276 ?> 277 277 </div> 278 278 <div class="clear"></div> … … 280 280 281 281 <div id="major-publishing-actions"> 282 <?php283 /**284 * Fires at the beginning of the publishing actions section of the Publish meta box.285 *286 * @since 2.7.0287 * @since 4.9.0 Added the `$post` parameter.288 *289 * @param WP_Post|null $post WP_Post object for the current post on Edit Post screen,290 * null on Edit Link screen.291 */292 do_action( 'post_submitbox_start', $post );293 ?>282 <?php 283 /** 284 * Fires at the beginning of the publishing actions section of the Publish meta box. 285 * 286 * @since 2.7.0 287 * @since 4.9.0 Added the `$post` parameter. 288 * 289 * @param WP_Post|null $post WP_Post object for the current post on Edit Post screen, 290 * null on Edit Link screen. 291 */ 292 do_action( 'post_submitbox_start', $post ); 293 ?> 294 294 <div id="delete-action"> 295 <?php296 if ( current_user_can( 'delete_post', $post->ID ) ) {297 if ( ! EMPTY_TRASH_DAYS ) {298 $delete_text = __( 'Delete Permanently' );299 } else {300 $delete_text = __( 'Move to Trash' );301 }302 ?>295 <?php 296 if ( current_user_can( 'delete_post', $post->ID ) ) { 297 if ( ! EMPTY_TRASH_DAYS ) { 298 $delete_text = __( 'Delete Permanently' ); 299 } else { 300 $delete_text = __( 'Move to Trash' ); 301 } 302 ?> 303 303 <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php echo $delete_text; ?></a> 304 304 <?php 305 }306 ?>305 } 306 ?> 307 307 </div> 308 308 309 309 <div id="publishing-action"> 310 310 <span class="spinner"></span> 311 <?php312 if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {313 if ( $can_publish ) :314 if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :315 ?>311 <?php 312 if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) { 313 if ( $can_publish ) : 314 if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : 315 ?> 316 316 <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> 317 <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>318 <?php else : ?>317 <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> 318 <?php else : ?> 319 319 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" /> 320 320 <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> 321 <?php322 endif;321 <?php 322 endif; 323 323 else : 324 ?>324 ?> 325 325 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" /> 326 326 <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?> 327 <?php328 endif;329 } else {330 ?>327 <?php 328 endif; 329 } else { 330 ?> 331 331 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 332 332 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 333 <?php334 }335 ?>333 <?php 334 } 335 ?> 336 336 </div> 337 337 <div class="clear"></div> … … 339 339 </div> 340 340 341 <?php341 <?php 342 342 } 343 343 … … 350 350 */ 351 351 function attachment_submit_meta_box( $post ) { 352 ?>352 ?> 353 353 <div class="submitbox" id="submitpost"> 354 354 355 355 <div id="minor-publishing"> 356 356 357 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>357 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 358 358 <div style="display:none;"> 359 <?php submit_button( __( 'Save' ), '', 'save' ); ?>359 <?php submit_button( __( 'Save' ), '', 'save' ); ?> 360 360 </div> 361 361 … … 419 419 </div> 420 420 421 <?php421 <?php 422 422 } 423 423 … … 450 450 $post_formats[0][] = $post_format; 451 451 } 452 ?>452 ?> 453 453 <div id="post-formats-select"> 454 454 <fieldset> … … 460 460 </fieldset> 461 461 </div> 462 <?php462 <?php 463 463 endif; 464 464 endif; … … 502 502 $terms_to_edit = ''; 503 503 } 504 ?>504 ?> 505 505 <div class="tagsdiv" id="<?php echo $tax_name; ?>"> 506 506 <div class="jaxtag"> … … 522 522 <ul class="tagchecklist" role="list"></ul> 523 523 </div> 524 <?php if ( $user_can_assign_terms ) : ?>524 <?php if ( $user_can_assign_terms ) : ?> 525 525 <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> 526 526 <?php endif; ?> 527 <?php527 <?php 528 528 } 529 529 … … 580 580 <?php 581 581 wp_terms_checklist( 582 $post->ID, array( 582 $post->ID, 583 array( 583 584 'taxonomy' => $tax_name, 584 585 'popular_cats' => $popular_ids, 585 586 ) 586 587 ); 587 ?>588 ?> 588 589 </ul> 589 590 </div> … … 658 659 */ 659 660 function post_excerpt_meta_box( $post ) { 660 ?>661 ?> 661 662 <label class="screen-reader-text" for="excerpt"><?php _e( 'Excerpt' ); ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea> 662 663 <p> 663 <?php664 <?php 664 665 printf( 665 666 /* translators: %s: Codex URL */ … … 667 668 __( 'https://codex.wordpress.org/Excerpt' ) 668 669 ); 669 ?>670 ?> 670 671 </p> 671 <?php672 <?php 672 673 } 673 674 … … 691 692 } 692 693 693 ?>694 ?> 694 695 <p> 695 696 <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label> … … 698 699 <p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p> 699 700 <p> 700 <?php701 <?php 701 702 printf( 702 703 /* translators: %s: Codex URL */ … … 704 705 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) 705 706 ); 706 ?>707 ?> 707 708 </p> 708 <?php709 if ( ! empty( $pings ) ) {710 echo $pings;711 }709 <?php 710 if ( ! empty( $pings ) ) { 711 echo $pings; 712 } 712 713 } 713 714 … … 720 721 */ 721 722 function post_custom_meta_box( $post ) { 722 ?>723 ?> 723 724 <div id="postcustomstuff"> 724 725 <div id="ajax-response"></div> 725 <?php726 $metadata = has_meta( $post->ID );727 foreach ( $metadata as $key => $value ) {728 if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {729 unset( $metadata[ $key ] );730 }731 }732 list_meta( $metadata );733 meta_form( $post );734 ?>726 <?php 727 $metadata = has_meta( $post->ID ); 728 foreach ( $metadata as $key => $value ) { 729 if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) { 730 unset( $metadata[ $key ] ); 731 } 732 } 733 list_meta( $metadata ); 734 meta_form( $post ); 735 ?> 735 736 </div> 736 737 <p> 737 <?php738 <?php 738 739 printf( 739 740 /* translators: %s: Codex URL */ … … 741 742 __( 'https://codex.wordpress.org/Using_Custom_Fields' ) 742 743 ); 743 ?>744 ?> 744 745 </p> 745 <?php746 <?php 746 747 } 747 748 … … 754 755 */ 755 756 function post_comment_status_meta_box( $post ) { 756 ?>757 ?> 757 758 <input name="advanced_view" type="hidden" value="1" /> 758 759 <p class="meta-options"> … … 778 779 ?> 779 780 </p> 780 <?php781 <?php 781 782 } 782 783 … … 845 846 /** This filter is documented in wp-admin/edit-tag-form.php */ 846 847 $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post ); 847 ?>848 ?> 848 849 <label class="screen-reader-text" for="post_name"><?php _e( 'Slug' ); ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" /> 849 <?php850 <?php 850 851 } 851 852 … … 861 862 function post_author_meta_box( $post ) { 862 863 global $user_ID; 863 ?>864 ?> 864 865 <label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label> 865 <?php866 <?php 866 867 wp_dropdown_users( 867 868 array( … … 920 921 $pages = wp_dropdown_pages( $dropdown_args ); 921 922 if ( ! empty( $pages ) ) : 922 ?>923 ?> 923 924 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> 924 <?php echo $pages; ?>925 <?php925 <?php echo $pages; ?> 926 <?php 926 927 endif; // end empty pages check 927 928 endif; // end hierarchical check. … … 931 932 ?> 932 933 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label> 933 <?php934 /**935 * Fires immediately after the label inside the 'Template' section936 * of the 'Page Attributes' meta box.937 *938 * @since 4.4.0939 *940 * @param string $template The template used for the current post.941 * @param WP_Post $post The current post.942 */943 do_action( 'page_attributes_meta_box_template', $template, $post );944 ?>934 <?php 935 /** 936 * Fires immediately after the label inside the 'Template' section 937 * of the 'Page Attributes' meta box. 938 * 939 * @since 4.4.0 940 * 941 * @param string $template The template used for the current post. 942 * @param WP_Post $post The current post. 943 */ 944 do_action( 'page_attributes_meta_box_template', $template, $post ); 945 ?> 945 946 </p> 946 947 <select name="page_template" id="page_template"> 947 <?php948 /**949 * Filters the title of the default page template displayed in the drop-down.950 *951 * @since 4.1.0952 *953 * @param string $label The display value for the default page template title.954 * @param string $context Where the option label is displayed. Possible values955 * include 'meta-box' or 'quick-edit'.956 */957 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );958 ?>948 <?php 949 /** 950 * Filters the title of the default page template displayed in the drop-down. 951 * 952 * @since 4.1.0 953 * 954 * @param string $label The display value for the default page template title. 955 * @param string $context Where the option label is displayed. Possible values 956 * include 'meta-box' or 'quick-edit'. 957 */ 958 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' ); 959 ?> 959 960 <option value="default"><?php echo esc_html( $default_title ); ?></option> 960 <?php page_template_dropdown( $template, $post->post_type ); ?>961 <?php page_template_dropdown( $template, $post->post_type ); ?> 961 962 </select> 962 963 <?php endif; ?> 963 <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>964 <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?> 964 965 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p> 965 966 <input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" /> 966 <?php967 /**968 * Fires before the help hint text in the 'Page Attributes' meta box.969 *970 * @since 4.9.0971 *972 * @param WP_Post $post The current post.973 */974 do_action( 'page_attributes_misc_attributes', $post );975 ?>976 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>967 <?php 968 /** 969 * Fires before the help hint text in the 'Page Attributes' meta box. 970 * 971 * @since 4.9.0 972 * 973 * @param WP_Post $post The current post. 974 */ 975 do_action( 'page_attributes_misc_attributes', $post ); 976 ?> 977 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?> 977 978 <p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> 978 <?php 979 endif; 979 <?php 980 980 endif; 981 endif; 981 982 } 982 983 … … 991 992 */ 992 993 function link_submit_meta_box( $link ) { 993 ?>994 ?> 994 995 <div class="submitbox" id="submitlink"> 995 996 996 997 <div id="minor-publishing"> 997 998 998 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>999 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?> 999 1000 <div style="display:none;"> 1000 <?php submit_button( __( 'Save' ), '', 'save', false ); ?>1001 <?php submit_button( __( 'Save' ), '', 'save', false ); ?> 1001 1002 </div> 1002 1003 1003 1004 <div id="minor-publishing-actions"> 1004 1005 <div id="preview-action"> 1005 <?php if ( ! empty( $link->link_id ) ) { ?>1006 <?php if ( ! empty( $link->link_id ) ) { ?> 1006 1007 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a> 1007 1008 <?php } ?> … … 1019 1020 1020 1021 <div id="major-publishing-actions"> 1021 <?php1022 /** This action is documented in wp-admin/includes/meta-boxes.php */1023 do_action( 'post_submitbox_start', null );1024 ?>1022 <?php 1023 /** This action is documented in wp-admin/includes/meta-boxes.php */ 1024 do_action( 'post_submitbox_start', null ); 1025 ?> 1025 1026 <div id="delete-action"> 1026 <?php1027 if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {1028 ?>1027 <?php 1028 if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) { 1029 ?> 1029 1030 <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> 1030 1031 <?php } ?> … … 1032 1033 1033 1034 <div id="publishing-action"> 1034 <?php if ( ! empty( $link->link_id ) ) { ?>1035 <?php if ( ! empty( $link->link_id ) ) { ?> 1035 1036 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" /> 1036 1037 <?php } else { ?> … … 1040 1041 <div class="clear"></div> 1041 1042 </div> 1042 <?php1043 /**1044 * Fires at the end of the Publish box in the Link editing screen.1045 *1046 * @since 2.5.01047 */1048 do_action( 'submitlink_box' );1049 ?>1043 <?php 1044 /** 1045 * Fires at the end of the Publish box in the Link editing screen. 1046 * 1047 * @since 2.5.0 1048 */ 1049 do_action( 'submitlink_box' ); 1050 ?> 1050 1051 <div class="clear"></div> 1051 1052 </div> 1052 <?php1053 <?php 1053 1054 } 1054 1055 … … 1061 1062 */ 1062 1063 function link_categories_meta_box( $link ) { 1063 ?>1064 ?> 1064 1065 <div id="taxonomy-linkcategory" class="categorydiv"> 1065 1066 <ul id="category-tabs" class="category-tabs"> … … 1097 1098 </div> 1098 1099 </div> 1099 <?php1100 <?php 1100 1101 } 1101 1102 … … 1109 1110 function link_target_meta_box( $link ) { 1110 1111 1111 ?>1112 ?> 1112 1113 <fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend> 1113 1114 <p><label for="link_target_blank" class="selectit"> 1114 1115 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_blank' ) ? 'checked="checked"' : '' ); ?> /> 1115 <?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p>1116 <?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p> 1116 1117 <p><label for="link_target_top" class="selectit"> 1117 1118 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_top' ) ? 'checked="checked"' : '' ); ?> /> 1118 <?php _e( '<code>_top</code> — current window or tab, with no frames.' ); ?></label></p>1119 <?php _e( '<code>_top</code> — current window or tab, with no frames.' ); ?></label></p> 1119 1120 <p><label for="link_target_none" class="selectit"> 1120 1121 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '' ) ? 'checked="checked"' : '' ); ?> /> 1121 <?php _e( '<code>_none</code> — same window or tab.' ); ?></label></p>1122 <?php _e( '<code>_none</code> — same window or tab.' ); ?></label></p> 1122 1123 </fieldset> 1123 1124 <p><?php _e( 'Choose the target frame for your link.' ); ?></p> 1124 <?php1125 <?php 1125 1126 } 1126 1127 … … 1174 1175 */ 1175 1176 function link_xfn_meta_box( $link ) { 1176 ?>1177 ?> 1177 1178 <table class="links-table"> 1178 1179 <tr> … … 1281 1282 </table> 1282 1283 <p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.' ); ?></p> 1283 <?php1284 <?php 1284 1285 } 1285 1286 … … 1292 1293 */ 1293 1294 function link_advanced_meta_box( $link ) { 1294 ?>1295 ?> 1295 1296 <table class="links-table" cellpadding="0"> 1296 1297 <tr> … … 1322 1323 </tr> 1323 1324 </table> 1324 <?php1325 <?php 1325 1326 } 1326 1327 … … 1355 1356 $value = $meta[ $key ]; 1356 1357 } 1357 ?>1358 ?> 1358 1359 <p> 1359 1360 <label for="title"><?php echo $label; ?></label><br /> 1360 1361 <input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" /> 1361 1362 </p> 1362 <?php1363 <?php 1363 1364 endforeach; 1364 1365 }
Note: See TracChangeset
for help on using the changeset viewer.