Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:33:45 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve comments in some wp-admin files per the documentation standards.

Follow-up to [47084].

Props passoniate, apedog.
Fixes #49223, #49227.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r47088 r47119  
    11<?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//
    412
    513/**
     
    3139<div id="minor-publishing">
    3240
    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. ?>
    3442<div style="display:none;">
    3543    <?php submit_button( __( 'Save' ), '', 'save' ); ?>
     
    7280<input type="hidden" name="wp-preview" id="wp-preview" value="" />
    7381</div>
    74 <?php endif; // public post type ?>
     82<?php endif; // is_post_type_viewable() ?>
    7583    <?php
    7684    /**
     
    203211
    204212    if ( 0 != $post->ID ) {
    205         if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
     213        if ( 'future' == $post->post_status ) { // Scheduled for publishing at a future date.
    206214            /* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
    207215            $stamp = __( 'Scheduled for: %s' );
    208         } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
     216        } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // Already published.
    209217            /* translators: Post date information. %s: Date on which the post was published. */
    210218            $stamp = __( 'Published on: %s' );
    211         } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
     219        } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified.
    212220            $stamp = __( 'Publish <b>immediately</b>' );
    213         } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
     221        } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified.
    214222            /* translators: Post date information. %s: Date on which the post is to be published. */
    215223            $stamp = __( 'Schedule for: %s' );
    216         } else { // draft, 1 or more saves, date specified
     224        } else { // Draft, 1 or more saves, date specified.
    217225            /* translators: Post date information. %s: Date on which the post is to be published. */
    218226            $stamp = __( 'Publish on: %s' );
     
    223231            date_i18n( $time_format, strtotime( $post->post_date ) )
    224232        );
    225     } else { // draft (no saves, and thus no date specified)
     233    } else { // Draft (no saves, and thus no date specified).
    226234        $stamp = __( 'Publish <b>immediately</b>' );
    227235        $date  = sprintf(
     
    244252endif;
    245253
    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.
    247255        ?>
    248256<div class="misc-pub-section curtime misc-pub-curtime">
     
    372380<div id="minor-publishing">
    373381
    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. ?>
    375383<div style="display:none;">
    376384    <?php submit_button( __( 'Save' ), '', 'save' ); ?>
     
    463471                $post_format = '0';
    464472            }
    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.
    466474            if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) {
    467475                $post_formats[0][] = $post_format;
     
    592600            <?php
    593601            $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' />";
    595604            ?>
    596605            <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
     
    793802     * @param WP_Post $post WP_Post object of the current post.
    794803     */
    795     do_action( 'post_comment_status_meta_box-options', $post );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     804    do_action( 'post_comment_status_meta_box-options', $post ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    796805    ?>
    797806</p>
     
    904913}
    905914
    906 // -- Page related Meta Boxes
     915//
     916// Page-related Meta Boxes.
     917//
    907918
    908919/**
     
    942953            <?php echo $pages; ?>
    943954            <?php
    944         endif; // end empty pages check
    945     endif;  // end hierarchical check.
     955        endif; // End empty pages check.
     956    endif;  // End hierarchical check.
    946957
    947958    if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :
     
    9991010}
    10001011
    1001 // -- Link related Meta Boxes
     1012//
     1013// Link-related Meta Boxes.
     1014//
    10021015
    10031016/**
     
    10141027<div id="minor-publishing">
    10151028
    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. ?>
    10171030<div style="display:none;">
    10181031    <?php submit_button( __( 'Save' ), '', 'save', false ); ?>
     
    11641177
    11651178    if ( ! empty( $deprecated ) ) {
    1166         _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented
     1179        _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented.
    11671180    }
    11681181
     
    14141427        // We should aim to show the revisions meta box only when there are revisions.
    14151428        if ( count( $revisions ) > 1 ) {
    1416             reset( $revisions ); // Reset pointer for key()
     1429            reset( $revisions ); // Reset pointer for key().
    14171430            $publish_callback_args = array(
    14181431                'revisions_count'        => count( $revisions ),
     
    14411454    }
    14421455
    1443     // all taxonomies
     1456    // All taxonomies.
    14441457    foreach ( get_object_taxonomies( $post ) as $tax_name ) {
    14451458        $taxonomy = get_taxonomy( $tax_name );
     
    15241537
    15251538    if ( in_array( get_post_status( $post ), $stati ) ) {
    1526         // If the post type support comments, or the post has comments, allow the
    1527         // Comments meta box.
     1539        // If the post type support comments, or the post has comments,
     1540        // allow the Comments meta box.
    15281541        if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
    15291542            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.