Changeset 47119 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 01/29/2020 12:33:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r47088 r47119 1 1 <?php 2 3 // -- Post related Meta Boxes 2 /** 3 * WordPress Administration Meta Boxes API. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 // 10 // Post-related Meta Boxes. 11 // 4 12 5 13 /** … … 31 39 <div id="minor-publishing"> 32 40 33 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>41 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> 34 42 <div style="display:none;"> 35 43 <?php submit_button( __( 'Save' ), '', 'save' ); ?> … … 72 80 <input type="hidden" name="wp-preview" id="wp-preview" value="" /> 73 81 </div> 74 <?php endif; // public post type?>82 <?php endif; // is_post_type_viewable() ?> 75 83 <?php 76 84 /** … … 203 211 204 212 if ( 0 != $post->ID ) { 205 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date213 if ( 'future' == $post->post_status ) { // Scheduled for publishing at a future date. 206 214 /* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */ 207 215 $stamp = __( 'Scheduled for: %s' ); 208 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published216 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // Already published. 209 217 /* translators: Post date information. %s: Date on which the post was published. */ 210 218 $stamp = __( 'Published on: %s' ); 211 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified219 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified. 212 220 $stamp = __( 'Publish <b>immediately</b>' ); 213 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified221 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified. 214 222 /* translators: Post date information. %s: Date on which the post is to be published. */ 215 223 $stamp = __( 'Schedule for: %s' ); 216 } else { // draft, 1 or more saves, date specified224 } else { // Draft, 1 or more saves, date specified. 217 225 /* translators: Post date information. %s: Date on which the post is to be published. */ 218 226 $stamp = __( 'Publish on: %s' ); … … 223 231 date_i18n( $time_format, strtotime( $post->post_date ) ) 224 232 ); 225 } else { // draft (no saves, and thus no date specified)233 } else { // Draft (no saves, and thus no date specified). 226 234 $stamp = __( 'Publish <b>immediately</b>' ); 227 235 $date = sprintf( … … 244 252 endif; 245 253 246 if ( $can_publish ) : // Contributors don't get to choose the date of publish 254 if ( $can_publish ) : // Contributors don't get to choose the date of publish. 247 255 ?> 248 256 <div class="misc-pub-section curtime misc-pub-curtime"> … … 372 380 <div id="minor-publishing"> 373 381 374 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>382 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> 375 383 <div style="display:none;"> 376 384 <?php submit_button( __( 'Save' ), '', 'save' ); ?> … … 463 471 $post_format = '0'; 464 472 } 465 // Add in the current one if it isn't there yet, in case the current theme doesn't support it 473 // Add in the current one if it isn't there yet, in case the current theme doesn't support it. 466 474 if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) { 467 475 $post_formats[0][] = $post_format; … … 592 600 <?php 593 601 $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; 594 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. 602 // Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks. 603 echo "<input type='hidden' name='{$name}[]' value='0' />"; 595 604 ?> 596 605 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> … … 793 802 * @param WP_Post $post WP_Post object of the current post. 794 803 */ 795 do_action( 'post_comment_status_meta_box-options', $post ); 804 do_action( 'post_comment_status_meta_box-options', $post ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 796 805 ?> 797 806 </p> … … 904 913 } 905 914 906 // -- Page related Meta Boxes 915 // 916 // Page-related Meta Boxes. 917 // 907 918 908 919 /** … … 942 953 <?php echo $pages; ?> 943 954 <?php 944 endif; // end empty pages check945 endif; // end hierarchical check.955 endif; // End empty pages check. 956 endif; // End hierarchical check. 946 957 947 958 if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) : … … 999 1010 } 1000 1011 1001 // -- Link related Meta Boxes 1012 // 1013 // Link-related Meta Boxes. 1014 // 1002 1015 1003 1016 /** … … 1014 1027 <div id="minor-publishing"> 1015 1028 1016 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>1029 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> 1017 1030 <div style="display:none;"> 1018 1031 <?php submit_button( __( 'Save' ), '', 'save', false ); ?> … … 1164 1177 1165 1178 if ( ! empty( $deprecated ) ) { 1166 _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented 1179 _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented. 1167 1180 } 1168 1181 … … 1414 1427 // We should aim to show the revisions meta box only when there are revisions. 1415 1428 if ( count( $revisions ) > 1 ) { 1416 reset( $revisions ); // Reset pointer for key() 1429 reset( $revisions ); // Reset pointer for key(). 1417 1430 $publish_callback_args = array( 1418 1431 'revisions_count' => count( $revisions ), … … 1441 1454 } 1442 1455 1443 // all taxonomies1456 // All taxonomies. 1444 1457 foreach ( get_object_taxonomies( $post ) as $tax_name ) { 1445 1458 $taxonomy = get_taxonomy( $tax_name ); … … 1524 1537 1525 1538 if ( in_array( get_post_status( $post ), $stati ) ) { 1526 // If the post type support comments, or the post has comments, allow the1527 // Comments meta box.1539 // If the post type support comments, or the post has comments, 1540 // allow the Comments meta box. 1528 1541 if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { 1529 1542 add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
Note: See TracChangeset
for help on using the changeset viewer.