WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (2 years 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-includes/load.php

    r41922 r42217  
    212212    header( 'Content-Type: text/html; charset=utf-8' );
    213213    header( 'Retry-After: 600' );
     214
     215    $dir_attr = '';
     216    if ( is_rtl() ) {
     217        $dir_attr = ' dir="rtl"';
     218    }
    214219?>
    215220    <!DOCTYPE html>
    216     <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
     221    <html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    217222    <head>
    218223    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Note: See TracChangeset for help on using the changeset viewer.