WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (20 months ago)
Author:
pento
Message:

General: Reformat inline if () statements inside HTML tags.

This pattern occurs a handful of times across the codebase:

<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">

Unfortunately, it doesn't really play nicely with phpcbf, so all instances need to be removed in preperation for auto code formatting.

See #41057.

File:
1 edited

Legend:

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

    r42203 r42217  
    3838<div id="minor-publishing-actions">
    3939<div id="save-action">
    40 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
    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" />
     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<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
    4248<span class="spinner"></span>
    4349<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
     
    104110?>
    105111</span>
    106 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    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>
     112<?php
     113    if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
     114        $private_style = '';
     115        if ( 'private' == $post->post_status ) {
     116            $private_style = 'style="display:none"';
     117        }
     118?>
     119<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>
    108120
    109121<div id="post-status-select" class="hide-if-js">
Note: See TracChangeset for help on using the changeset viewer.