WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/17/2018 01:50:26 AM (3 years ago)
Author:
pento
Message:

Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:

  • Multiline function calls must now put each parameter on a new line.
  • Auto-formatting files is now part of the grunt precommit script.
  • Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.

File:
1 edited

Legend:

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

    r43569 r43571  
    2626    $post_type_object = get_post_type_object( $post_type );
    2727    $can_publish      = current_user_can( $post_type_object->cap->publish_posts );
    28 ?>
     28    ?>
    2929<div class="submitbox" id="submitpost">
    3030
    3131<div id="minor-publishing">
    3232
    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 ?>
    3434<div style="display:none;">
    35 <?php submit_button( __( 'Save' ), '', 'save' ); ?>
     35    <?php submit_button( __( 'Save' ), '', 'save' ); ?>
    3636</div>
    3737
    3838<div id="minor-publishing-actions">
    3939<div id="save-action">
    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 ?>
     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        ?>
    4747<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" />
    4848<span class="spinner"></span>
     
    5252<?php } ?>
    5353</div>
    54 <?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
     54    <?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
    5555<div id="preview-action">
    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 ?>
     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        ?>
    7171<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>
    7272<input type="hidden" name="wp-preview" id="wp-preview" value="" />
    7373</div>
    7474<?php endif; // public post type ?>
    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 ?>
     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    ?>
    8585<div class="clear"></div>
    8686</div><!-- #minor-publishing-actions -->
     
    8989
    9090<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">
    9292            <?php
    9393
     
    110110                    break;
    111111            }
    112 ?>
     112            ?>
    113113</span>
    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 ?>
     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        ?>
    121121<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>
    122122
     
    125125<label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label>
    126126<select name="post_status" id="post_status">
    127 <?php if ( 'publish' == $post->post_status ) : ?>
     127        <?php if ( 'publish' == $post->post_status ) : ?>
    128128<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
    129129<?php elseif ( 'private' == $post->post_status ) : ?>
     
    133133<?php endif; ?>
    134134<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 ) : ?>
    136136<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
    137137<?php else : ?>
     
    147147
    148148<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">
    150150                            <?php
    151151
     
    166166
    167167                            echo esc_html( $visibility_trans );
    168 ?>
     168                            ?>
    169169</span>
    170 <?php if ( $can_publish ) { ?>
     170    <?php if ( $can_publish ) { ?>
    171171<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>
    172172
    173173<div id="post-visibility-select" class="hide-if-js">
    174174<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' ) : ?>
    176176<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> />
    177177<?php endif; ?>
    178178<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
    179179<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' ) ) : ?>
    181181<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>
    182182<?php endif; ?>
     
    194194</div><!-- .misc-pub-section -->
    195195
    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)
    207217        $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        ?>
    223223<div class="misc-pub-section misc-pub-revisions">
    224     <?php
     224        <?php
    225225        /* translators: Post revisions heading. %s: The number of available revisions */
    226226        printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
    227     ?>
     227        ?>
    228228    <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>
    229229</div>
    230 <?php
     230        <?php
    231231endif;
    232232
    233 if ( $can_publish ) : // Contributors don't get to choose the date of publish
    234 ?>
     233    if ( $can_publish ) : // Contributors don't get to choose the date of publish
     234        ?>
    235235<div class="misc-pub-section curtime misc-pub-curtime">
    236236    <span id="timestamp">
    237     <?php printf( $stamp, $date ); ?></span>
     237        <?php printf( $stamp, $date ); ?></span>
    238238    <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>
    239239    <fieldset id="timestampdiv" class="hide-if-js">
    240240    <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 ); ?>
    242242    </fieldset>
    243243</div><?php // /misc-pub-section ?>
    244244<?php endif; ?>
    245245
    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 ) ) : ?>
    247247    <div class="notice notice-info notice-alt inline">
    248248        <p>
     
    262262        </p>
    263263    </div>
    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 ?>
     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    ?>
    277277</div>
    278278<div class="clear"></div>
     
    280280
    281281<div id="major-publishing-actions">
    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 ?>
     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    ?>
    294294<div id="delete-action">
    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     ?>
     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        ?>
    303303<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php echo $delete_text; ?></a>
    304304                                                    <?php
    305 }
    306 ?>
     305    }
     306    ?>
    307307</div>
    308308
    309309<div id="publishing-action">
    310310<span class="spinner"></span>
    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         ?>
     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                ?>
    316316        <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 : ?>
    319319        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" />
    320320        <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
    321 <?php
    322 endif;
     321    <?php
     322    endif;
    323323    else :
    324     ?>
     324        ?>
    325325        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />
    326326        <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
    327 <?php
    328     endif;
    329 } else {
    330 ?>
     327        <?php
     328        endif;
     329    } else {
     330        ?>
    331331        <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
    332332        <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" />
    333 <?php
    334 }
    335 ?>
     333        <?php
     334    }
     335    ?>
    336336</div>
    337337<div class="clear"></div>
     
    339339</div>
    340340
    341 <?php
     341    <?php
    342342}
    343343
     
    350350 */
    351351function attachment_submit_meta_box( $post ) {
    352 ?>
     352    ?>
    353353<div class="submitbox" id="submitpost">
    354354
    355355<div id="minor-publishing">
    356356
    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 ?>
    358358<div style="display:none;">
    359 <?php submit_button( __( 'Save' ), '', 'save' ); ?>
     359    <?php submit_button( __( 'Save' ), '', 'save' ); ?>
    360360</div>
    361361
     
    419419</div>
    420420
    421 <?php
     421    <?php
    422422}
    423423
     
    450450                $post_formats[0][] = $post_format;
    451451            }
    452         ?>
     452            ?>
    453453        <div id="post-formats-select">
    454454        <fieldset>
     
    460460        </fieldset>
    461461    </div>
    462     <?php
     462            <?php
    463463    endif;
    464464endif;
     
    502502        $terms_to_edit = '';
    503503    }
    504 ?>
     504    ?>
    505505<div class="tagsdiv" id="<?php echo $tax_name; ?>">
    506506    <div class="jaxtag">
     
    522522    <ul class="tagchecklist" role="list"></ul>
    523523</div>
    524 <?php if ( $user_can_assign_terms ) : ?>
     524    <?php if ( $user_can_assign_terms ) : ?>
    525525<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>
    526526<?php endif; ?>
    527 <?php
     527    <?php
    528528}
    529529
     
    580580                <?php
    581581                wp_terms_checklist(
    582                     $post->ID, array(
     582                    $post->ID,
     583                    array(
    583584                        'taxonomy'     => $tax_name,
    584585                        'popular_cats' => $popular_ids,
    585586                    )
    586587                );
    587 ?>
     588                ?>
    588589            </ul>
    589590        </div>
     
    658659 */
    659660function post_excerpt_meta_box( $post ) {
    660 ?>
     661    ?>
    661662<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>
    662663<p>
    663 <?php
     664    <?php
    664665    printf(
    665666        /* translators: %s: Codex URL */
     
    667668        __( 'https://codex.wordpress.org/Excerpt' )
    668669    );
    669 ?>
     670    ?>
    670671</p>
    671 <?php
     672    <?php
    672673}
    673674
     
    691692    }
    692693
    693 ?>
     694    ?>
    694695<p>
    695696    <label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
     
    698699<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
    699700<p>
    700 <?php
     701    <?php
    701702    printf(
    702703        /* translators: %s: Codex URL */
     
    704705        __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
    705706    );
    706 ?>
     707    ?>
    707708</p>
    708 <?php
    709 if ( ! empty( $pings ) ) {
    710     echo $pings;
    711 }
     709    <?php
     710    if ( ! empty( $pings ) ) {
     711        echo $pings;
     712    }
    712713}
    713714
     
    720721 */
    721722function post_custom_meta_box( $post ) {
    722 ?>
     723    ?>
    723724<div id="postcustomstuff">
    724725<div id="ajax-response"></div>
    725 <?php
    726 $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    ?>
    735736</div>
    736737<p>
    737 <?php
     738    <?php
    738739    printf(
    739740        /* translators: %s: Codex URL */
     
    741742        __( 'https://codex.wordpress.org/Using_Custom_Fields' )
    742743    );
    743 ?>
     744    ?>
    744745</p>
    745 <?php
     746    <?php
    746747}
    747748
     
    754755 */
    755756function post_comment_status_meta_box( $post ) {
    756 ?>
     757    ?>
    757758<input name="advanced_view" type="hidden" value="1" />
    758759<p class="meta-options">
     
    778779    ?>
    779780</p>
    780 <?php
     781    <?php
    781782}
    782783
     
    845846    /** This filter is documented in wp-admin/edit-tag-form.php */
    846847    $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
    847 ?>
     848    ?>
    848849<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 <?php
     850    <?php
    850851}
    851852
     
    861862function post_author_meta_box( $post ) {
    862863    global $user_ID;
    863 ?>
     864    ?>
    864865<label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
    865 <?php
     866    <?php
    866867    wp_dropdown_users(
    867868        array(
     
    920921        $pages         = wp_dropdown_pages( $dropdown_args );
    921922        if ( ! empty( $pages ) ) :
    922 ?>
     923            ?>
    923924<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p>
    924 <?php echo $pages; ?>
    925 <?php
     925            <?php echo $pages; ?>
     926            <?php
    926927        endif; // end empty pages check
    927928    endif;  // end hierarchical check.
     
    931932        ?>
    932933<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
    933 <?php
    934 /**
    935  * Fires immediately after the label inside the 'Template' section
    936  * of the 'Page Attributes' meta box.
    937  *
    938  * @since 4.4.0
    939  *
    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        ?>
    945946</p>
    946947<select name="page_template" id="page_template">
    947 <?php
    948 /**
    949  * Filters the title of the default page template displayed in the drop-down.
    950  *
    951  * @since 4.1.0
    952  *
    953  * @param string $label   The display value for the default page template title.
    954  * @param string $context Where the option label is displayed. Possible values
    955  *                        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        ?>
    959960<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 ); ?>
    961962</select>
    962963<?php endif; ?>
    963 <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
     964    <?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
    964965<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p>
    965966<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />
    966 <?php
    967 /**
    968  * Fires before the help hint text in the 'Page Attributes' meta box.
    969  *
    970  * @since 4.9.0
    971  *
    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() ) : ?>
    977978<p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>
    978 <?php
    979 endif;
     979            <?php
    980980    endif;
     981    endif;
    981982}
    982983
     
    991992 */
    992993function link_submit_meta_box( $link ) {
    993 ?>
     994    ?>
    994995<div class="submitbox" id="submitlink">
    995996
    996997<div id="minor-publishing">
    997998
    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 ?>
    9991000<div style="display:none;">
    1000 <?php submit_button( __( 'Save' ), '', 'save', false ); ?>
     1001    <?php submit_button( __( 'Save' ), '', 'save', false ); ?>
    10011002</div>
    10021003
    10031004<div id="minor-publishing-actions">
    10041005<div id="preview-action">
    1005 <?php if ( ! empty( $link->link_id ) ) { ?>
     1006    <?php if ( ! empty( $link->link_id ) ) { ?>
    10061007    <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a>
    10071008<?php } ?>
     
    10191020
    10201021<div id="major-publishing-actions">
    1021 <?php
    1022 /** 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    ?>
    10251026<div id="delete-action">
    1026 <?php
    1027 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        ?>
    10291030    <a class="submitdelete deletion" href="<?php echo wp_nonce_url( "link.php?action=delete&amp;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>
    10301031<?php } ?>
     
    10321033
    10331034<div id="publishing-action">
    1034 <?php if ( ! empty( $link->link_id ) ) { ?>
     1035    <?php if ( ! empty( $link->link_id ) ) { ?>
    10351036    <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" />
    10361037<?php } else { ?>
     
    10401041<div class="clear"></div>
    10411042</div>
    1042 <?php
    1043 /**
    1044  * Fires at the end of the Publish box in the Link editing screen.
    1045  *
    1046  * @since 2.5.0
    1047  */
    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    ?>
    10501051<div class="clear"></div>
    10511052</div>
    1052 <?php
     1053    <?php
    10531054}
    10541055
     
    10611062 */
    10621063function link_categories_meta_box( $link ) {
    1063 ?>
     1064    ?>
    10641065<div id="taxonomy-linkcategory" class="categorydiv">
    10651066    <ul id="category-tabs" class="category-tabs">
     
    10971098    </div>
    10981099</div>
    1099 <?php
     1100    <?php
    11001101}
    11011102
     
    11091110function link_target_meta_box( $link ) {
    11101111
    1111 ?>
     1112    ?>
    11121113<fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
    11131114<p><label for="link_target_blank" class="selectit">
    11141115<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> &mdash; new window or tab.' ); ?></label></p>
     1116    <?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
    11161117<p><label for="link_target_top" class="selectit">
    11171118<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> &mdash; current window or tab, with no frames.' ); ?></label></p>
     1119    <?php _e( '<code>_top</code> &mdash; current window or tab, with no frames.' ); ?></label></p>
    11191120<p><label for="link_target_none" class="selectit">
    11201121<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> &mdash; same window or tab.' ); ?></label></p>
     1122    <?php _e( '<code>_none</code> &mdash; same window or tab.' ); ?></label></p>
    11221123</fieldset>
    11231124<p><?php _e( 'Choose the target frame for your link.' ); ?></p>
    1124 <?php
     1125    <?php
    11251126}
    11261127
     
    11741175 */
    11751176function link_xfn_meta_box( $link ) {
    1176 ?>
     1177    ?>
    11771178<table class="links-table">
    11781179    <tr>
     
    12811282</table>
    12821283<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 <?php
     1284    <?php
    12841285}
    12851286
     
    12921293 */
    12931294function link_advanced_meta_box( $link ) {
    1294 ?>
     1295    ?>
    12951296<table class="links-table" cellpadding="0">
    12961297    <tr>
     
    13221323    </tr>
    13231324</table>
    1324 <?php
     1325    <?php
    13251326}
    13261327
     
    13551356            $value = $meta[ $key ];
    13561357        }
    1357     ?>
     1358        ?>
    13581359    <p>
    13591360        <label for="title"><?php echo $label; ?></label><br />
    13601361        <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 ); ?>" />
    13611362    </p>
    1362     <?php
     1363        <?php
    13631364    endforeach;
    13641365}
Note: See TracChangeset for help on using the changeset viewer.