Make WordPress Core


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (7 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-admin/setup-config.php

    r42201 r42217  
    9292    $body_classes = (array) $body_classes;
    9393    $body_classes[] = 'wp-core-ui';
     94    $dir_attr = '';
    9495    if ( is_rtl() ) {
    9596        $body_classes[] = 'rtl';
     97        $dir_attr = ' dir="rtl"';
    9698    }
    9799
     
    99101?>
    100102<!DOCTYPE html>
    101 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
     103<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    102104<head>
    103105    <meta name="viewport" content="width=device-width" />
Note: See TracChangeset for help on using the changeset viewer.