Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r42259 r42343  
    3232
    3333    $templates = array();
    34     $name = (string) $name;
     34    $name      = (string) $name;
    3535    if ( '' !== $name ) {
    3636        $templates[] = "header-{$name}.php";
     
    6767
    6868    $templates = array();
    69     $name = (string) $name;
     69    $name      = (string) $name;
    7070    if ( '' !== $name ) {
    7171        $templates[] = "footer-{$name}.php";
    7272    }
    7373
    74     $templates[]    = 'footer.php';
     74    $templates[] = 'footer.php';
    7575
    7676    locate_template( $templates, true );
     
    102102
    103103    $templates = array();
    104     $name = (string) $name;
    105     if ( '' !== $name )
     104    $name      = (string) $name;
     105    if ( '' !== $name ) {
    106106        $templates[] = "sidebar-{$name}.php";
     107    }
    107108
    108109    $templates[] = 'sidebar.php';
     
    147148
    148149    $templates = array();
    149     $name = (string) $name;
    150     if ( '' !== $name )
     150    $name      = (string) $name;
     151    if ( '' !== $name ) {
    151152        $templates[] = "{$slug}-{$name}.php";
     153    }
    152154
    153155    $templates[] = "{$slug}.php";
    154156
    155     locate_template($templates, true, false);
     157    locate_template( $templates, true, false );
    156158}
    157159
     
    213215                    <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" />
    214216                </label>
    215                 <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     217                <input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
    216218            </form>';
    217219        } else {
     
    220222                    <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
    221223                    <input type="text" value="' . get_search_query() . '" name="s" id="s" />
    222                     <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     224                    <input type="submit" id="searchsubmit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
    223225                </div>
    224226            </form>';
     
    235237    $result = apply_filters( 'get_search_form', $form );
    236238
    237     if ( null === $result )
     239    if ( null === $result ) {
    238240        $result = $form;
    239 
    240     if ( $echo )
     241    }
     242
     243    if ( $echo ) {
    241244        echo $result;
    242     else
     245    } else {
    243246        return $result;
     247    }
    244248}
    245249
     
    256260 * @return string|void String when retrieving.
    257261 */
    258 function wp_loginout($redirect = '', $echo = true) {
    259     if ( ! is_user_logged_in() )
    260         $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
    261     else
    262         $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
     262function wp_loginout( $redirect = '', $echo = true ) {
     263    if ( ! is_user_logged_in() ) {
     264        $link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __( 'Log in' ) . '</a>';
     265    } else {
     266        $link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __( 'Log out' ) . '</a>';
     267    }
    263268
    264269    if ( $echo ) {
     
    287292 * @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url().
    288293 */
    289 function wp_logout_url($redirect = '') {
     294function wp_logout_url( $redirect = '' ) {
    290295    $args = array( 'action' => 'logout' );
    291     if ( !empty($redirect) ) {
     296    if ( ! empty( $redirect ) ) {
    292297        $args['redirect_to'] = urlencode( $redirect );
    293298    }
    294299
    295     $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
     300    $logout_url = add_query_arg( $args, site_url( 'wp-login.php', 'login' ) );
    296301    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    297302
     
    317322 * @return string The login URL. Not HTML-encoded.
    318323 */
    319 function wp_login_url($redirect = '', $force_reauth = false) {
    320     $login_url = site_url('wp-login.php', 'login');
    321 
    322     if ( !empty($redirect) )
    323         $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);
    324 
    325     if ( $force_reauth )
    326         $login_url = add_query_arg('reauth', '1', $login_url);
     324function wp_login_url( $redirect = '', $force_reauth = false ) {
     325    $login_url = site_url( 'wp-login.php', 'login' );
     326
     327    if ( ! empty( $redirect ) ) {
     328        $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
     329    }
     330
     331    if ( $force_reauth ) {
     332        $login_url = add_query_arg( 'reauth', '1', $login_url );
     333    }
    327334
    328335    /**
     
    390397function wp_login_form( $args = array() ) {
    391398    $defaults = array(
    392         'echo' => true,
     399        'echo'           => true,
    393400        // Default 'redirect' value takes the user back to the request URI.
    394         'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
    395         'form_id' => 'loginform',
     401        'redirect'       => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
     402        'form_id'        => 'loginform',
    396403        'label_username' => __( 'Username or Email Address' ),
    397404        'label_password' => __( 'Password' ),
    398405        'label_remember' => __( 'Remember Me' ),
    399         'label_log_in' => __( 'Log In' ),
    400         'id_username' => 'user_login',
    401         'id_password' => 'user_pass',
    402         'id_remember' => 'rememberme',
    403         'id_submit' => 'wp-submit',
    404         'remember' => true,
     406        'label_log_in'   => __( 'Log In' ),
     407        'id_username'    => 'user_login',
     408        'id_password'    => 'user_pass',
     409        'id_remember'    => 'rememberme',
     410        'id_submit'      => 'wp-submit',
     411        'remember'       => true,
    405412        'value_username' => '',
    406413        // Set 'value_remember' to true to default the "Remember me" checkbox to checked.
     
    476483        </form>';
    477484
    478     if ( $args['echo'] )
     485    if ( $args['echo'] ) {
    479486        echo $form;
    480     else
     487    } else {
    481488        return $form;
     489    }
    482490}
    483491
     
    492500function wp_lostpassword_url( $redirect = '' ) {
    493501    $args = array( 'action' => 'lostpassword' );
    494     if ( !empty($redirect) ) {
     502    if ( ! empty( $redirect ) ) {
    495503        $args['redirect_to'] = urlencode( $redirect );
    496504    }
    497505
    498     $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
     506    $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login' ) );
    499507
    500508    /**
     
    524532function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
    525533    if ( ! is_user_logged_in() ) {
    526         if ( get_option('users_can_register') )
    527             $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __('Register') . '</a>' . $after;
    528         else
     534        if ( get_option( 'users_can_register' ) ) {
     535            $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __( 'Register' ) . '</a>' . $after;
     536        } else {
    529537            $link = '';
     538        }
    530539    } elseif ( current_user_can( 'read' ) ) {
    531         $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
     540        $link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin' ) . '</a>' . $after;
    532541    } else {
    533542        $link = '';
     
    633642 */
    634643function get_bloginfo( $show = '', $filter = 'raw' ) {
    635     switch( $show ) {
    636         case 'home' : // DEPRECATED
    637         case 'siteurl' : // DEPRECATED
    638             _deprecated_argument( __FUNCTION__, '2.2.0', sprintf(
    639                 /* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument */
    640                 __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),
    641                 '<code>' . $show . '</code>',
    642                 '<code>bloginfo()</code>',
    643                 '<code>url</code>'
    644             ) );
    645         case 'url' :
     644    switch ( $show ) {
     645        case 'home': // DEPRECATED
     646        case 'siteurl': // DEPRECATED
     647            _deprecated_argument(
     648                __FUNCTION__, '2.2.0', sprintf(
     649                    /* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument */
     650                    __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),
     651                    '<code>' . $show . '</code>',
     652                    '<code>bloginfo()</code>',
     653                    '<code>url</code>'
     654                )
     655            );
     656        case 'url':
    646657            $output = home_url();
    647658            break;
    648         case 'wpurl' :
     659        case 'wpurl':
    649660            $output = site_url();
    650661            break;
    651662        case 'description':
    652             $output = get_option('blogdescription');
     663            $output = get_option( 'blogdescription' );
    653664            break;
    654665        case 'rdf_url':
    655             $output = get_feed_link('rdf');
     666            $output = get_feed_link( 'rdf' );
    656667            break;
    657668        case 'rss_url':
    658             $output = get_feed_link('rss');
     669            $output = get_feed_link( 'rss' );
    659670            break;
    660671        case 'rss2_url':
    661             $output = get_feed_link('rss2');
     672            $output = get_feed_link( 'rss2' );
    662673            break;
    663674        case 'atom_url':
    664             $output = get_feed_link('atom');
     675            $output = get_feed_link( 'atom' );
    665676            break;
    666677        case 'comments_atom_url':
    667             $output = get_feed_link('comments_atom');
     678            $output = get_feed_link( 'comments_atom' );
    668679            break;
    669680        case 'comments_rss2_url':
    670             $output = get_feed_link('comments_rss2');
     681            $output = get_feed_link( 'comments_rss2' );
    671682            break;
    672683        case 'pingback_url':
     
    684695            break;
    685696        case 'admin_email':
    686             $output = get_option('admin_email');
     697            $output = get_option( 'admin_email' );
    687698            break;
    688699        case 'charset':
    689             $output = get_option('blog_charset');
    690             if ('' == $output) $output = 'UTF-8';
     700            $output = get_option( 'blog_charset' );
     701            if ( '' == $output ) {
     702                $output = 'UTF-8';
     703            }
    691704            break;
    692         case 'html_type' :
    693             $output = get_option('html_type');
     705        case 'html_type':
     706            $output = get_option( 'html_type' );
    694707            break;
    695708        case 'version':
     
    709722            break;
    710723        case 'text_direction':
    711             _deprecated_argument( __FUNCTION__, '2.2.0', sprintf(
    712                 /* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name */
    713                 __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),
    714                 '<code>' . $show . '</code>',
    715                 '<code>bloginfo()</code>',
    716                 '<code>is_rtl()</code>'
    717             ) );
     724            _deprecated_argument(
     725                __FUNCTION__, '2.2.0', sprintf(
     726                    /* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name */
     727                    __( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),
     728                    '<code>' . $show . '</code>',
     729                    '<code>bloginfo()</code>',
     730                    '<code>is_rtl()</code>'
     731                )
     732            );
    718733            if ( function_exists( 'is_rtl' ) ) {
    719734                $output = is_rtl() ? 'rtl' : 'ltr';
     
    724739        case 'name':
    725740        default:
    726             $output = get_option('blogname');
     741            $output = get_option( 'blogname' );
    727742            break;
    728743    }
    729744
    730745    $url = true;
    731     if (strpos($show, 'url') === false &&
    732         strpos($show, 'directory') === false &&
    733         strpos($show, 'home') === false)
     746    if ( strpos( $show, 'url' ) === false &&
     747        strpos( $show, 'directory' ) === false &&
     748        strpos( $show, 'home' ) === false ) {
    734749        $url = false;
     750    }
    735751
    736752    if ( 'display' == $filter ) {
     
    865881 */
    866882function get_custom_logo( $blog_id = 0 ) {
    867     $html = '';
     883    $html          = '';
    868884    $switched_blog = false;
    869885
     
    895911         * it because wp_get_attachment_image() already adds the alt attribute.
    896912         */
    897         $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
     913        $html = sprintf(
     914            '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
    898915            esc_url( home_url( '/' ) ),
    899916            wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
    900917        );
    901     }
    902 
    903     // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
     918    } // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
    904919    elseif ( is_customize_preview() ) {
    905         $html = sprintf( '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
     920        $html = sprintf(
     921            '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
    906922            esc_url( home_url( '/' ) )
    907923        );
     
    972988        $title['title'] = __( 'Page not found' );
    973989
    974     // If it's a search, use a dynamic search results title.
     990        // If it's a search, use a dynamic search results title.
    975991    } elseif ( is_search() ) {
    976992        /* translators: %s: search phrase */
    977993        $title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' ), get_search_query() );
    978994
    979     // If on the front page, use the site title.
     995        // If on the front page, use the site title.
    980996    } elseif ( is_front_page() ) {
    981997        $title['title'] = get_bloginfo( 'name', 'display' );
    982998
    983     // If on a post type archive, use the post type archive title.
     999        // If on a post type archive, use the post type archive title.
    9841000    } elseif ( is_post_type_archive() ) {
    9851001        $title['title'] = post_type_archive_title( '', false );
    9861002
    987     // If on a taxonomy archive, use the term title.
     1003        // If on a taxonomy archive, use the term title.
    9881004    } elseif ( is_tax() ) {
    9891005        $title['title'] = single_term_title( '', false );
    9901006
    991     /*
    992      * If we're on the blog page that is not the homepage or
    993      * a single post of any post type, use the post title.
    994      */
     1007        /*
     1008        * If we're on the blog page that is not the homepage or
     1009        * a single post of any post type, use the post title.
     1010        */
    9951011    } elseif ( is_home() || is_singular() ) {
    9961012        $title['title'] = single_post_title( '', false );
    9971013
    998     // If on a category or tag archive, use the term title.
     1014        // If on a category or tag archive, use the term title.
    9991015    } elseif ( is_category() || is_tag() ) {
    10001016        $title['title'] = single_term_title( '', false );
    10011017
    1002     // If on an author archive, use the author's display name.
     1018        // If on an author archive, use the author's display name.
    10031019    } elseif ( is_author() && $author = get_queried_object() ) {
    10041020        $title['title'] = $author->display_name;
    10051021
    1006     // If it's a date archive, use the date as the title.
     1022        // If it's a date archive, use the date as the title.
    10071023    } elseif ( is_year() ) {
    10081024        $title['title'] = get_the_date( _x( 'Y', 'yearly archives date format' ) );
     
    12481264    $_post = get_queried_object();
    12491265
    1250     if ( !isset($_post->post_title) )
     1266    if ( ! isset( $_post->post_title ) ) {
    12511267        return;
     1268    }
    12521269
    12531270    /**
     
    12601277     */
    12611278    $title = apply_filters( 'single_post_title', $_post->post_title, $_post );
    1262     if ( $display )
     1279    if ( $display ) {
    12631280        echo $prefix . $title;
    1264     else
     1281    } else {
    12651282        return $prefix . $title;
     1283    }
    12661284}
    12671285
     
    12791297 */
    12801298function post_type_archive_title( $prefix = '', $display = true ) {
    1281     if ( ! is_post_type_archive() )
     1299    if ( ! is_post_type_archive() ) {
    12821300        return;
     1301    }
    12831302
    12841303    $post_type = get_query_var( 'post_type' );
    1285     if ( is_array( $post_type ) )
     1304    if ( is_array( $post_type ) ) {
    12861305        $post_type = reset( $post_type );
     1306    }
    12871307
    12881308    $post_type_obj = get_post_type_object( $post_type );
     
    12981318    $title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );
    12991319
    1300     if ( $display )
     1320    if ( $display ) {
    13011321        echo $prefix . $title;
    1302     else
     1322    } else {
    13031323        return $prefix . $title;
     1324    }
    13041325}
    13051326
     
    13541375    $term = get_queried_object();
    13551376
    1356     if ( !$term )
     1377    if ( ! $term ) {
    13571378        return;
     1379    }
    13581380
    13591381    if ( is_category() ) {
     
    13881410    }
    13891411
    1390     if ( empty( $term_name ) )
     1412    if ( empty( $term_name ) ) {
    13911413        return;
    1392 
    1393     if ( $display )
     1414    }
     1415
     1416    if ( $display ) {
    13941417        echo $prefix . $term_name;
    1395     else
     1418    } else {
    13961419        return $prefix . $term_name;
     1420    }
    13971421}
    13981422
     
    14131437 * @return string|void Title when retrieving.
    14141438 */
    1415 function single_month_title($prefix = '', $display = true ) {
     1439function single_month_title( $prefix = '', $display = true ) {
    14161440    global $wp_locale;
    14171441
    1418     $m = get_query_var('m');
    1419     $year = get_query_var('year');
    1420     $monthnum = get_query_var('monthnum');
    1421 
    1422     if ( !empty($monthnum) && !empty($year) ) {
    1423         $my_year = $year;
    1424         $my_month = $wp_locale->get_month($monthnum);
    1425     } elseif ( !empty($m) ) {
    1426         $my_year = substr($m, 0, 4);
    1427         $my_month = $wp_locale->get_month(substr($m, 4, 2));
    1428     }
    1429 
    1430     if ( empty($my_month) )
     1442    $m        = get_query_var( 'm' );
     1443    $year     = get_query_var( 'year' );
     1444    $monthnum = get_query_var( 'monthnum' );
     1445
     1446    if ( ! empty( $monthnum ) && ! empty( $year ) ) {
     1447        $my_year  = $year;
     1448        $my_month = $wp_locale->get_month( $monthnum );
     1449    } elseif ( ! empty( $m ) ) {
     1450        $my_year  = substr( $m, 0, 4 );
     1451        $my_month = $wp_locale->get_month( substr( $m, 4, 2 ) );
     1452    }
     1453
     1454    if ( empty( $my_month ) ) {
    14311455        return false;
     1456    }
    14321457
    14331458    $result = $prefix . $my_month . $prefix . $my_year;
    14341459
    1435     if ( !$display )
     1460    if ( ! $display ) {
    14361461        return $result;
     1462    }
    14371463    echo $result;
    14381464}
     
    16371663 * @return string HTML link content for archive.
    16381664 */
    1639 function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
    1640     $text = wptexturize($text);
    1641     $url = esc_url($url);
    1642 
    1643     if ('link' == $format)
     1665function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '' ) {
     1666    $text = wptexturize( $text );
     1667    $url  = esc_url( $url );
     1668
     1669    if ( 'link' == $format ) {
    16441670        $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n";
    1645     elseif ('option' == $format)
     1671    } elseif ( 'option' == $format ) {
    16461672        $link_html = "\t<option value='$url'>$before $text $after</option>\n";
    1647     elseif ('html' == $format)
     1673    } elseif ( 'html' == $format ) {
    16481674        $link_html = "\t<li>$before<a href='$url'>$text</a>$after</li>\n";
    1649     else // custom
     1675    } else { // custom
    16501676        $link_html = "\t$before<a href='$url'>$text</a>$after\n";
     1677    }
    16511678
    16521679    /**
     
    17051732
    17061733    $defaults = array(
    1707         'type' => 'monthly', 'limit' => '',
    1708         'format' => 'html', 'before' => '',
    1709         'after' => '', 'show_post_count' => false,
    1710         'echo' => 1, 'order' => 'DESC',
    1711         'post_type' => 'post'
     1734        'type'            => 'monthly',
     1735        'limit'           => '',
     1736        'format'          => 'html',
     1737        'before'          => '',
     1738        'after'           => '',
     1739        'show_post_count' => false,
     1740        'echo'            => 1,
     1741        'order'           => 'DESC',
     1742        'post_type'       => 'post',
    17121743    );
    17131744
     
    17671798    if ( 'monthly' == $r['type'] ) {
    17681799        $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
    1769         $key = md5( $query );
    1770         $key = "wp_get_archives:$key:$last_changed";
     1800        $key   = md5( $query );
     1801        $key   = "wp_get_archives:$key:$last_changed";
    17711802        if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
    17721803            $results = $wpdb->get_results( $query );
     
    17901821    } elseif ( 'yearly' == $r['type'] ) {
    17911822        $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
    1792         $key = md5( $query );
    1793         $key = "wp_get_archives:$key:$last_changed";
     1823        $key   = md5( $query );
     1824        $key   = "wp_get_archives:$key:$last_changed";
    17941825        if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
    17951826            $results = $wpdb->get_results( $query );
     
    17981829        if ( $results ) {
    17991830            $after = $r['after'];
    1800             foreach ( (array) $results as $result) {
     1831            foreach ( (array) $results as $result ) {
    18011832                $url = get_year_link( $result->year );
    18021833                if ( 'post' !== $r['post_type'] ) {
     
    18121843    } elseif ( 'daily' == $r['type'] ) {
    18131844        $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
    1814         $key = md5( $query );
    1815         $key = "wp_get_archives:$key:$last_changed";
     1845        $key   = md5( $query );
     1846        $key   = "wp_get_archives:$key:$last_changed";
    18161847        if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
    18171848            $results = $wpdb->get_results( $query );
     
    18211852            $after = $r['after'];
    18221853            foreach ( (array) $results as $result ) {
    1823                 $url  = get_day_link( $result->year, $result->month, $result->dayofmonth );
     1854                $url = get_day_link( $result->year, $result->month, $result->dayofmonth );
    18241855                if ( 'post' !== $r['post_type'] ) {
    18251856                    $url = add_query_arg( 'post_type', $r['post_type'], $url );
     
    18341865        }
    18351866    } elseif ( 'weekly' == $r['type'] ) {
    1836         $week = _wp_mysql_week( '`post_date`' );
     1867        $week  = _wp_mysql_week( '`post_date`' );
    18371868        $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
    1838         $key = md5( $query );
    1839         $key = "wp_get_archives:$key:$last_changed";
     1869        $key   = md5( $query );
     1870        $key   = "wp_get_archives:$key:$last_changed";
    18401871        if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
    18411872            $results = $wpdb->get_results( $query );
     
    18521883                    $arc_week_start = date_i18n( get_option( 'date_format' ), $arc_week['start'] );
    18531884                    $arc_week_end   = date_i18n( get_option( 'date_format' ), $arc_week['end'] );
    1854                     $url            = add_query_arg( array( 'm' => $arc_year, 'w' => $result->week, ), home_url( '/' ) );
     1885                    $url            = add_query_arg(
     1886                        array(
     1887                            'm' => $arc_year,
     1888                            'w' => $result->week,
     1889                        ), home_url( '/' )
     1890                    );
    18551891                    if ( 'post' !== $r['post_type'] ) {
    18561892                        $url = add_query_arg( 'post_type', $r['post_type'], $url );
    18571893                    }
    1858                     $text           = $arc_week_start . $archive_week_separator . $arc_week_end;
     1894                    $text = $arc_week_start . $archive_week_separator . $arc_week_end;
    18591895                    if ( $r['show_post_count'] ) {
    18601896                        $r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
     
    18641900            }
    18651901        }
    1866     } elseif ( ( 'postbypost' == $r['type'] ) || ('alpha' == $r['type'] ) ) {
     1902    } elseif ( ( 'postbypost' == $r['type'] ) || ( 'alpha' == $r['type'] ) ) {
    18671903        $orderby = ( 'alpha' == $r['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
    1868         $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
    1869         $key = md5( $query );
    1870         $key = "wp_get_archives:$key:$last_changed";
     1904        $query   = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
     1905        $key     = md5( $query );
     1906        $key     = "wp_get_archives:$key:$last_changed";
    18711907        if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
    18721908            $results = $wpdb->get_results( $query );
     
    19031939 * @return float Days since the start of the week.
    19041940 */
    1905 function calendar_week_mod($num) {
     1941function calendar_week_mod( $num ) {
    19061942    $base = 7;
    1907     return ($num - $base*floor($num/$base));
     1943    return ( $num - $base * floor( $num / $base ) );
    19081944}
    19091945
     
    19301966    global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
    19311967
    1932     $key = md5( $m . $monthnum . $year );
     1968    $key   = md5( $m . $monthnum . $year );
    19331969    $cache = wp_cache_get( 'get_calendar', 'calendar' );
    19341970
     
    19511987    // Quick check. If we have no posts at all, abort!
    19521988    if ( ! $posts ) {
    1953         $gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");
     1989        $gotsome = $wpdb->get_var( "SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" );
    19541990        if ( ! $gotsome ) {
    19551991            $cache[ $key ] = '';
     
    19642000    // week_begins = 0 stands for Sunday
    19652001    $week_begins = (int) get_option( 'start_of_week' );
    1966     $ts = current_time( 'timestamp' );
     2002    $ts          = current_time( 'timestamp' );
    19672003
    19682004    // Let's figure out when we are
    19692005    if ( ! empty( $monthnum ) && ! empty( $year ) ) {
    19702006        $thismonth = zeroise( intval( $monthnum ), 2 );
    1971         $thisyear = (int) $year;
     2007        $thisyear  = (int) $year;
    19722008    } elseif ( ! empty( $w ) ) {
    19732009        // We need to get the month from MySQL
    19742010        $thisyear = (int) substr( $m, 0, 4 );
    19752011        //it seems MySQL's weeks disagree with PHP's
    1976         $d = ( ( $w - 1 ) * 7 ) + 6;
    1977         $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
     2012        $d         = ( ( $w - 1 ) * 7 ) + 6;
     2013        $thismonth = $wpdb->get_var( "SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')" );
    19782014    } elseif ( ! empty( $m ) ) {
    19792015        $thisyear = (int) substr( $m, 0, 4 );
     
    19842020        }
    19852021    } else {
    1986         $thisyear = gmdate( 'Y', $ts );
     2022        $thisyear  = gmdate( 'Y', $ts );
    19872023        $thismonth = gmdate( 'm', $ts );
    19882024    }
    19892025
    1990     $unixmonth = mktime( 0, 0 , 0, $thismonth, 1, $thisyear );
    1991     $last_day = date( 't', $unixmonth );
     2026    $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );
     2027    $last_day  = date( 't', $unixmonth );
    19922028
    19932029    // Get the next and previous month and year with at least one post
    1994     $previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
     2030    $previous = $wpdb->get_row(
     2031        "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
    19952032        FROM $wpdb->posts
    19962033        WHERE post_date < '$thisyear-$thismonth-01'
    19972034        AND post_type = 'post' AND post_status = 'publish'
    19982035            ORDER BY post_date DESC
    1999             LIMIT 1");
    2000     $next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
     2036            LIMIT 1"
     2037    );
     2038    $next     = $wpdb->get_row(
     2039        "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
    20012040        FROM $wpdb->posts
    20022041        WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'
    20032042        AND post_type = 'post' AND post_status = 'publish'
    20042043            ORDER BY post_date ASC
    2005             LIMIT 1");
     2044            LIMIT 1"
     2045    );
    20062046
    20072047    /* translators: Calendar caption: 1: month name, 2: 4-digit year */
    2008     $calendar_caption = _x('%1$s %2$s', 'calendar caption');
    2009     $calendar_output = '<table id="wp-calendar">
     2048    $calendar_caption = _x( '%1$s %2$s', 'calendar caption' );
     2049    $calendar_output  = '<table id="wp-calendar">
    20102050    <caption>' . sprintf(
    20112051        $calendar_caption,
     
    20232063
    20242064    foreach ( $myweek as $wd ) {
    2025         $day_name = $initial ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd );
    2026         $wd = esc_attr( $wd );
     2065        $day_name         = $initial ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd );
     2066        $wd               = esc_attr( $wd );
    20272067        $calendar_output .= "\n\t\t<th scope=\"col\" title=\"$wd\">$day_name</th>";
    20282068    }
     
    20362076
    20372077    if ( $previous ) {
    2038         $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">&laquo; ' .
     2078        $calendar_output .= "\n\t\t" . '<td colspan="3" id="prev"><a href="' . get_month_link( $previous->year, $previous->month ) . '">&laquo; ' .
    20392079            $wp_locale->get_month_abbrev( $wp_locale->get_month( $previous->month ) ) .
    20402080        '</a></td>';
    20412081    } else {
    2042         $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
    2043     }
    2044 
    2045     $calendar_output .= "\n\t\t".'<td class="pad">&nbsp;</td>';
     2082        $calendar_output .= "\n\t\t" . '<td colspan="3" id="prev" class="pad">&nbsp;</td>';
     2083    }
     2084
     2085    $calendar_output .= "\n\t\t" . '<td class="pad">&nbsp;</td>';
    20462086
    20472087    if ( $next ) {
    2048         $calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
     2088        $calendar_output .= "\n\t\t" . '<td colspan="3" id="next"><a href="' . get_month_link( $next->year, $next->month ) . '">' .
    20492089            $wp_locale->get_month_abbrev( $wp_locale->get_month( $next->month ) ) .
    20502090        ' &raquo;</a></td>';
    20512091    } else {
    2052         $calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
     2092        $calendar_output .= "\n\t\t" . '<td colspan="3" id="next" class="pad">&nbsp;</td>';
    20532093    }
    20542094
     
    20632103
    20642104    // Get days with posts
    2065     $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
     2105    $dayswithposts = $wpdb->get_results(
     2106        "SELECT DISTINCT DAYOFMONTH(post_date)
    20662107        FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
    20672108        AND post_type = 'post' AND post_status = 'publish'
    2068         AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);
     2109        AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N
     2110    );
    20692111    if ( $dayswithposts ) {
    20702112        foreach ( (array) $dayswithposts as $daywith ) {
     
    20762118    $pad = calendar_week_mod( date( 'w', $unixmonth ) - $week_begins );
    20772119    if ( 0 != $pad ) {
    2078         $calendar_output .= "\n\t\t".'<td colspan="'. esc_attr( $pad ) .'" class="pad">&nbsp;</td>';
    2079     }
    2080 
    2081     $newrow = false;
     2120        $calendar_output .= "\n\t\t" . '<td colspan="' . esc_attr( $pad ) . '" class="pad">&nbsp;</td>';
     2121    }
     2122
     2123    $newrow      = false;
    20822124    $daysinmonth = (int) date( 't', $unixmonth );
    20832125
    20842126    for ( $day = 1; $day <= $daysinmonth; ++$day ) {
    2085         if ( isset($newrow) && $newrow ) {
     2127        if ( isset( $newrow ) && $newrow ) {
    20862128            $calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t";
    20872129        }
     
    21002142            $date_format = date( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) );
    21012143            /* translators: Post calendar label. 1: Date */
    2102             $label = sprintf( __( 'Posts published on %s' ), $date_format );
     2144            $label            = sprintf( __( 'Posts published on %s' ), $date_format );
    21032145            $calendar_output .= sprintf(
    21042146                '<a href="%s" aria-label="%s">%s</a>',
     
    21122154        $calendar_output .= '</td>';
    21132155
    2114         if ( 6 == calendar_week_mod( date( 'w', mktime(0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
     2156        if ( 6 == calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
    21152157            $newrow = true;
    21162158        }
    21172159    }
    21182160
    2119     $pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0 , 0, $thismonth, $day, $thisyear ) ) - $week_begins );
     2161    $pad = 7 - calendar_week_mod( date( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins );
    21202162    if ( $pad != 0 && $pad != 7 ) {
    2121         $calendar_output .= "\n\t\t".'<td class="pad" colspan="'. esc_attr( $pad ) .'">&nbsp;</td>';
     2163        $calendar_output .= "\n\t\t" . '<td class="pad" colspan="' . esc_attr( $pad ) . '">&nbsp;</td>';
    21222164    }
    21232165    $calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>";
     
    21672209    $allowed = '';
    21682210    foreach ( (array) $allowedtags as $tag => $attributes ) {
    2169         $allowed .= '<'.$tag;
    2170         if ( 0 < count($attributes) ) {
     2211        $allowed .= '<' . $tag;
     2212        if ( 0 < count( $attributes ) ) {
    21712213            foreach ( $attributes as $attribute => $limits ) {
    2172                 $allowed .= ' '.$attribute.'=""';
     2214                $allowed .= ' ' . $attribute . '=""';
    21732215            }
    21742216        }
     
    21782220}
    21792221
    2180 /***** Date/Time tags *****/
     2222/***** Date/Time tags */
    21812223
    21822224/**
     
    22162258
    22172259    if ( is_new_day() ) {
    2218         $the_date = $before . get_the_date( $d ) . $after;
     2260        $the_date    = $before . get_the_date( $d ) . $after;
    22192261        $previousday = $currentday;
    22202262
     
    22322274        $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    22332275
    2234         if ( $echo )
     2276        if ( $echo ) {
    22352277            echo $the_date;
    2236         else
     2278        } else {
    22372279            return $the_date;
     2280        }
    22382281    }
    22392282}
     
    22892332 */
    22902333function the_modified_date( $d = '', $before = '', $after = '', $echo = true ) {
    2291     $the_modified_date = $before . get_the_modified_date($d) . $after;
     2334    $the_modified_date = $before . get_the_modified_date( $d ) . $after;
    22922335
    22932336    /**
     
    23042347    $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $d, $before, $after );
    23052348
    2306     if ( $echo )
     2349    if ( $echo ) {
    23072350        echo $the_modified_date;
    2308     else
     2351    } else {
    23092352        return $the_modified_date;
     2353    }
    23102354
    23112355}
     
    23792423 */
    23802424function get_the_time( $d = '', $post = null ) {
    2381     $post = get_post($post);
     2425    $post = get_post( $post );
    23822426
    23832427    if ( ! $post ) {
     
    23852429    }
    23862430
    2387     if ( '' == $d )
    2388         $the_time = get_post_time(get_option('time_format'), false, $post, true);
    2389     else
    2390         $the_time = get_post_time($d, false, $post, true);
     2431    if ( '' == $d ) {
     2432        $the_time = get_post_time( get_option( 'time_format' ), false, $post, true );
     2433    } else {
     2434        $the_time = get_post_time( $d, false, $post, true );
     2435    }
    23912436
    23922437    /**
     
    24172462 */
    24182463function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
    2419     $post = get_post($post);
     2464    $post = get_post( $post );
    24202465
    24212466    if ( ! $post ) {
     
    24232468    }
    24242469
    2425     if ( $gmt )
     2470    if ( $gmt ) {
    24262471        $time = $post->post_date_gmt;
    2427     else
     2472    } else {
    24282473        $time = $post->post_date;
    2429 
    2430     $time = mysql2date($d, $time, $translate);
     2474    }
     2475
     2476    $time = mysql2date( $d, $time, $translate );
    24312477
    24322478    /**
     
    24502496 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
    24512497 */
    2452 function the_modified_time($d = '') {
     2498function the_modified_time( $d = '' ) {
    24532499    /**
    24542500     * Filters the localized time a post was last modified, for display.
     
    24612507     *                                      specified in 'time_format' option.
    24622508     */
    2463     echo apply_filters( 'the_modified_time', get_the_modified_time($d), $d );
     2509    echo apply_filters( 'the_modified_time', get_the_modified_time( $d ), $d );
    24642510}
    24652511
     
    25162562 */
    25172563function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) {
    2518     $post = get_post($post);
     2564    $post = get_post( $post );
    25192565
    25202566    if ( ! $post ) {
     
    25222568    }
    25232569
    2524     if ( $gmt )
     2570    if ( $gmt ) {
    25252571        $time = $post->post_modified_gmt;
    2526     else
     2572    } else {
    25272573        $time = $post->post_modified;
    2528     $time = mysql2date($d, $time, $translate);
     2574    }
     2575    $time = mysql2date( $d, $time, $translate );
    25292576
    25302577    /**
     
    25762623 * @param string $after Optional Output after the date.
    25772624 */
    2578 function the_weekday_date($before='',$after='') {
     2625function the_weekday_date( $before = '', $after = '' ) {
    25792626    global $wp_locale, $currentday, $previousweekday;
    25802627    $the_weekday_date = '';
     
    25832630        $the_weekday_date .= $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) );
    25842631        $the_weekday_date .= $after;
    2585         $previousweekday = $currentday;
     2632        $previousweekday   = $currentday;
    25862633    }
    25872634
     
    26392686 */
    26402687function feed_links( $args = array() ) {
    2641     if ( !current_theme_supports('automatic-feed-links') )
     2688    if ( ! current_theme_supports( 'automatic-feed-links' ) ) {
    26422689        return;
     2690    }
    26432691
    26442692    $defaults = array(
    26452693        /* translators: Separator between blog name and feed type in feed links */
    2646         'separator' => _x('&raquo;', 'feed link'),
     2694        'separator' => _x( '&raquo;', 'feed link' ),
    26472695        /* translators: 1: blog title, 2: separator (raquo) */
    2648         'feedtitle' => __('%1$s %2$s Feed'),
     2696        'feedtitle' => __( '%1$s %2$s Feed' ),
    26492697        /* translators: 1: blog title, 2: separator (raquo) */
    2650         'comstitle' => __('%1$s %2$s Comments Feed'),
     2698        'comstitle' => __( '%1$s %2$s Comments Feed' ),
    26512699    );
    26522700
     
    26862734    $defaults = array(
    26872735        /* translators: Separator between blog name and feed type in feed links */
    2688         'separator'   => _x('&raquo;', 'feed link'),
     2736        'separator'     => _x( '&raquo;', 'feed link' ),
    26892737        /* translators: 1: blog name, 2: separator(raquo), 3: post title */
    2690         'singletitle' => __('%1$s %2$s %3$s Comments Feed'),
     2738        'singletitle'   => __( '%1$s %2$s %3$s Comments Feed' ),
    26912739        /* translators: 1: blog name, 2: separator(raquo), 3: category name */
    2692         'cattitle'    => __('%1$s %2$s %3$s Category Feed'),
     2740        'cattitle'      => __( '%1$s %2$s %3$s Category Feed' ),
    26932741        /* translators: 1: blog name, 2: separator(raquo), 3: tag name */
    2694         'tagtitle'    => __('%1$s %2$s %3$s Tag Feed'),
     2742        'tagtitle'      => __( '%1$s %2$s %3$s Tag Feed' ),
    26952743        /* translators: 1: blog name, 2: separator(raquo), 3: term name, 4: taxonomy singular name */
    2696         'taxtitle'    => __('%1$s %2$s %3$s %4$s Feed'),
     2744        'taxtitle'      => __( '%1$s %2$s %3$s %4$s Feed' ),
    26972745        /* translators: 1: blog name, 2: separator(raquo), 3: author name  */
    2698         'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
     2746        'authortitle'   => __( '%1$s %2$s Posts by %3$s Feed' ),
    26992747        /* translators: 1: blog name, 2: separator(raquo), 3: search phrase */
    2700         'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'),
     2748        'searchtitle'   => __( '%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed' ),
    27012749        /* translators: 1: blog name, 2: separator(raquo), 3: post type name */
    2702         'posttypetitle' => __('%1$s %2$s %3$s Feed'),
     2750        'posttypetitle' => __( '%1$s %2$s %3$s Feed' ),
    27032751    );
    27042752
     
    27062754
    27072755    if ( is_singular() ) {
    2708         $id = 0;
     2756        $id   = 0;
    27092757        $post = get_post( $id );
    27102758
    27112759        if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
    2712             $title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );
    2713             $href = get_post_comments_feed_link( $post->ID );
     2760            $title = sprintf( $args['singletitle'], get_bloginfo( 'name' ), $args['separator'], the_title_attribute( array( 'echo' => false ) ) );
     2761            $href  = get_post_comments_feed_link( $post->ID );
    27142762        }
    27152763    } elseif ( is_post_type_archive() ) {
    27162764        $post_type = get_query_var( 'post_type' );
    2717         if ( is_array( $post_type ) )
     2765        if ( is_array( $post_type ) ) {
    27182766            $post_type = reset( $post_type );
     2767        }
    27192768
    27202769        $post_type_obj = get_post_type_object( $post_type );
    2721         $title = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );
    2722         $href = get_post_type_archive_feed_link( $post_type_obj->name );
     2770        $title         = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], $post_type_obj->labels->name );
     2771        $href          = get_post_type_archive_feed_link( $post_type_obj->name );
    27232772    } elseif ( is_category() ) {
    27242773        $term = get_queried_object();
    27252774
    27262775        if ( $term ) {
    2727             $title = sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name );
    2728             $href = get_category_feed_link( $term->term_id );
     2776            $title = sprintf( $args['cattitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );
     2777            $href  = get_category_feed_link( $term->term_id );
    27292778        }
    27302779    } elseif ( is_tag() ) {
     
    27322781
    27332782        if ( $term ) {
    2734             $title = sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name );
    2735             $href = get_tag_feed_link( $term->term_id );
     2783            $title = sprintf( $args['tagtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name );
     2784            $href  = get_tag_feed_link( $term->term_id );
    27362785        }
    27372786    } elseif ( is_tax() ) {
    2738         $term = get_queried_object();
    2739         $tax = get_taxonomy( $term->taxonomy );
    2740         $title = sprintf( $args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name );
    2741         $href = get_term_feed_link( $term->term_id, $term->taxonomy );
     2787        $term = get_queried_object();
     2788        $tax  = get_taxonomy( $term->taxonomy );
     2789        $title = sprintf( $args['taxtitle'], get_bloginfo( 'name' ), $args['separator'], $term->name, $tax->labels->singular_name );
     2790        $href = get_term_feed_link( $term->term_id, $term->taxonomy );
    27422791    } elseif ( is_author() ) {
    2743         $author_id = intval( get_query_var('author') );
    2744 
    2745         $title = sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );
    2746         $href = get_author_feed_link( $author_id );
     2792        $author_id = intval( get_query_var( 'author' ) );
     2793
     2794        $title = sprintf( $args['authortitle'], get_bloginfo( 'name' ), $args['separator'], get_the_author_meta( 'display_name', $author_id ) );
     2795        $href  = get_author_feed_link( $author_id );
    27472796    } elseif ( is_search() ) {
    2748         $title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
    2749         $href = get_search_feed_link();
     2797        $title = sprintf( $args['searchtitle'], get_bloginfo( 'name' ), $args['separator'], get_search_query( false ) );
     2798        $href  = get_search_feed_link();
    27502799    } elseif ( is_post_type_archive() ) {
    2751         $title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) );
     2800        $title         = sprintf( $args['posttypetitle'], get_bloginfo( 'name' ), $args['separator'], post_type_archive_title( '', false ) );
    27522801        $post_type_obj = get_queried_object();
    2753         if ( $post_type_obj )
     2802        if ( $post_type_obj ) {
    27542803            $href = get_post_type_archive_feed_link( $post_type_obj->name );
    2755     }
    2756 
    2757     if ( isset($title) && isset($href) )
     2804        }
     2805    }
     2806
     2807    if ( isset( $title ) && isset( $href ) ) {
    27582808        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr( $title ) . '" href="' . esc_url( $href ) . '" />' . "\n";
     2809    }
    27592810}
    27602811
     
    27972848function noindex() {
    27982849    // If the blog is not public, tell robots to go away.
    2799     if ( '0' == get_option('blog_public') )
     2850    if ( '0' == get_option( 'blog_public' ) ) {
    28002851        wp_no_robots();
     2852    }
    28012853}
    28022854
     
    28262878
    28272879    $meta_tags = array();
    2828     $icon_32 = get_site_icon_url( 32 );
     2880    $icon_32   = get_site_icon_url( 32 );
    28292881    if ( empty( $icon_32 ) && is_customize_preview() ) {
    28302882        $icon_32 = '/favicon.ico'; // Serve default favicon URL in customizer so element can be updated for preview.
     
    29382990            }
    29392991
    2940             $atts['rel'] = $relation_type;
     2992            $atts['rel']  = $relation_type;
    29412993            $atts['href'] = $url;
    29422994
     
    29493001            foreach ( $atts as $attr => $value ) {
    29503002                if ( ! is_scalar( $value ) ||
    2951                     ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr )) ) {
     3003                    ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr ) ) ) {
    29523004
    29533005                    continue;
     
    30233075    global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;
    30243076
    3025     if ( !isset($wp_rich_edit) ) {
     3077    if ( ! isset( $wp_rich_edit ) ) {
    30263078        $wp_rich_edit = false;
    30273079
     
    30313083            } elseif ( $is_IE ) {
    30323084                $wp_rich_edit = ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE ' ) === false );
    3033             } elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && !wp_is_mobile() ) ) {
     3085            } elseif ( $is_gecko || $is_chrome || $is_edge || ( $is_opera && ! wp_is_mobile() ) ) {
    30343086                $wp_rich_edit = true;
    30353087            }
     
    30603112    $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults
    30613113    if ( wp_get_current_user() ) { // look for cookie
    3062         $ed = get_user_setting('editor', 'tinymce');
    3063         $r = ( in_array($ed, array('tinymce', 'html', 'test') ) ) ? $ed : $r;
     3114        $ed = get_user_setting( 'editor', 'tinymce' );
     3115        $r  = ( in_array( $ed, array( 'tinymce', 'html', 'test' ) ) ) ? $ed : $r;
    30643116    }
    30653117
     
    30943146 */
    30953147function wp_editor( $content, $editor_id, $settings = array() ) {
    3096     if ( ! class_exists( '_WP_Editors', false ) )
     3148    if ( ! class_exists( '_WP_Editors', false ) ) {
    30973149        require( ABSPATH . WPINC . '/class-wp-editor.php' );
    3098     _WP_Editors::editor($content, $editor_id, $settings);
     3150    }
     3151    _WP_Editors::editor( $content, $editor_id, $settings );
    30993152}
    31003153
     
    31443197    $settings = array(
    31453198        'codemirror' => array(
    3146             'indentUnit' => 4,
    3147             'indentWithTabs' => true,
    3148             'inputStyle' => 'contenteditable',
    3149             'lineNumbers' => true,
    3150             'lineWrapping' => true,
    3151             'styleActiveLine' => true,
     3199            'indentUnit'       => 4,
     3200            'indentWithTabs'   => true,
     3201            'inputStyle'       => 'contenteditable',
     3202            'lineNumbers'      => true,
     3203            'lineWrapping'     => true,
     3204            'styleActiveLine'  => true,
    31523205            'continueComments' => true,
    3153             'extraKeys' => array(
     3206            'extraKeys'        => array(
    31543207                'Ctrl-Space' => 'autocomplete',
    3155                 'Ctrl-/' => 'toggleComment',
    3156                 'Cmd-/' => 'toggleComment',
    3157                 'Alt-F' => 'findPersistent',
     3208                'Ctrl-/'     => 'toggleComment',
     3209                'Cmd-/'      => 'toggleComment',
     3210                'Alt-F'      => 'findPersistent',
    31583211            ),
    3159             'direction' => 'ltr', // Code is shown in LTR even in RTL languages.
    3160             'gutters' => array(),
     3212            'direction'        => 'ltr', // Code is shown in LTR even in RTL languages.
     3213            'gutters'          => array(),
    31613214        ),
    3162         'csslint' => array(
    3163             'errors' => true, // Parsing errors.
    3164             'box-model' => true,
     3215        'csslint'    => array(
     3216            'errors'                    => true, // Parsing errors.
     3217            'box-model'                 => true,
    31653218            'display-property-grouping' => true,
    3166             'duplicate-properties' => true,
    3167             'known-properties' => true,
    3168             'outline-none' => true,
     3219            'duplicate-properties'      => true,
     3220            'known-properties'          => true,
     3221            'outline-none'              => true,
    31693222        ),
    3170         'jshint' => array(
     3223        'jshint'     => array(
    31713224            // The following are copied from <https://github.com/WordPress/wordpress-develop/blob/4.8.1/.jshintrc>.
    3172             'boss' => true,
    3173             'curly' => true,
    3174             'eqeqeq' => true,
    3175             'eqnull' => true,
    3176             'es3' => true,
    3177             'expr' => true,
    3178             'immed' => true,
    3179             'noarg' => true,
    3180             'nonbsp' => true,
    3181             'onevar' => true,
     3225            'boss'     => true,
     3226            'curly'    => true,
     3227            'eqeqeq'   => true,
     3228            'eqnull'   => true,
     3229            'es3'      => true,
     3230            'expr'     => true,
     3231            'immed'    => true,
     3232            'noarg'    => true,
     3233            'nonbsp'   => true,
     3234            'onevar'   => true,
    31823235            'quotmark' => 'single',
    31833236            'trailing' => true,
    3184             'undef' => true,
    3185             'unused' => true,
    3186 
    3187             'browser' => true,
    3188 
    3189             'globals' => array(
    3190                 '_' => false,
     3237            'undef'    => true,
     3238            'unused'   => true,
     3239
     3240            'browser'  => true,
     3241
     3242            'globals'  => array(
     3243                '_'        => false,
    31913244                'Backbone' => false,
    3192                 'jQuery' => false,
    3193                 'JSON' => false,
    3194                 'wp' => false,
     3245                'jQuery'   => false,
     3246                'JSON'     => false,
     3247                'wp'       => false,
    31953248            ),
    31963249        ),
    3197         'htmlhint' => array(
    3198             'tagname-lowercase' => true,
    3199             'attr-lowercase' => true,
     3250        'htmlhint'   => array(
     3251            'tagname-lowercase'        => true,
     3252            'attr-lowercase'           => true,
    32003253            'attr-value-double-quotes' => true,
    3201             'doctype-first' => false,
    3202             'tag-pair' => true,
    3203             'spec-char-escape' => true,
    3204             'id-unique' => true,
    3205             'src-not-empty' => true,
    3206             'attr-no-duplication' => true,
    3207             'alt-require' => true,
     3254            'doctype-first'            => false,
     3255            'tag-pair'                 => true,
     3256            'spec-char-escape'         => true,
     3257            'id-unique'                => true,
     3258            'src-not-empty'            => true,
     3259            'attr-no-duplication'      => true,
     3260            'alt-require'              => true,
    32083261            'space-tab-mixed-disabled' => 'tab',
    3209             'attr-unsafe-chars' => true,
     3262            'attr-unsafe-chars'        => true,
    32103263        ),
    32113264    );
     
    33043357
    33053358    if ( 'text/css' === $type ) {
    3306         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3307             'mode' => 'css',
    3308             'lint' => true,
    3309             'autoCloseBrackets' => true,
    3310             'matchBrackets' => true,
    3311         ) );
     3359        $settings['codemirror'] = array_merge(
     3360            $settings['codemirror'], array(
     3361                'mode'              => 'css',
     3362                'lint'              => true,
     3363                'autoCloseBrackets' => true,
     3364                'matchBrackets'     => true,
     3365            )
     3366        );
    33123367    } elseif ( 'text/x-scss' === $type || 'text/x-less' === $type || 'text/x-sass' === $type ) {
    3313         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3314             'mode' => $type,
    3315             'lint' => false,
    3316             'autoCloseBrackets' => true,
    3317             'matchBrackets' => true,
    3318         ) );
     3368        $settings['codemirror'] = array_merge(
     3369            $settings['codemirror'], array(
     3370                'mode'              => $type,
     3371                'lint'              => false,
     3372                'autoCloseBrackets' => true,
     3373                'matchBrackets'     => true,
     3374            )
     3375        );
    33193376    } elseif ( 'text/x-diff' === $type ) {
    3320         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3321             'mode' => 'diff',
    3322         ) );
     3377        $settings['codemirror'] = array_merge(
     3378            $settings['codemirror'], array(
     3379                'mode' => 'diff',
     3380            )
     3381        );
    33233382    } elseif ( 'text/html' === $type ) {
    3324         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3325             'mode' => 'htmlmixed',
    3326             'lint' => true,
    3327             'autoCloseBrackets' => true,
    3328             'autoCloseTags' => true,
    3329             'matchTags' => array(
    3330                 'bothTags' => true,
    3331             ),
    3332         ) );
     3383        $settings['codemirror'] = array_merge(
     3384            $settings['codemirror'], array(
     3385                'mode'              => 'htmlmixed',
     3386                'lint'              => true,
     3387                'autoCloseBrackets' => true,
     3388                'autoCloseTags'     => true,
     3389                'matchTags'         => array(
     3390                    'bothTags' => true,
     3391                ),
     3392            )
     3393        );
    33333394
    33343395        if ( ! current_user_can( 'unfiltered_html' ) ) {
     
    33363397        }
    33373398    } elseif ( 'text/x-gfm' === $type ) {
    3338         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3339             'mode' => 'gfm',
    3340             'highlightFormatting' => true,
    3341         ) );
     3399        $settings['codemirror'] = array_merge(
     3400            $settings['codemirror'], array(
     3401                'mode'                => 'gfm',
     3402                'highlightFormatting' => true,
     3403            )
     3404        );
    33423405    } elseif ( 'application/javascript' === $type || 'text/javascript' === $type ) {
    3343         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3344             'mode' => 'javascript',
    3345             'lint' => true,
    3346             'autoCloseBrackets' => true,
    3347             'matchBrackets' => true,
    3348         ) );
     3406        $settings['codemirror'] = array_merge(
     3407            $settings['codemirror'], array(
     3408                'mode'              => 'javascript',
     3409                'lint'              => true,
     3410                'autoCloseBrackets' => true,
     3411                'matchBrackets'     => true,
     3412            )
     3413        );
    33493414    } elseif ( false !== strpos( $type, 'json' ) ) {
    3350         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3351             'mode' => array(
    3352                 'name' => 'javascript',
    3353             ),
    3354             'lint' => true,
    3355             'autoCloseBrackets' => true,
    3356             'matchBrackets' => true,
    3357         ) );
     3415        $settings['codemirror'] = array_merge(
     3416            $settings['codemirror'], array(
     3417                'mode'              => array(
     3418                    'name' => 'javascript',
     3419                ),
     3420                'lint'              => true,
     3421                'autoCloseBrackets' => true,
     3422                'matchBrackets'     => true,
     3423            )
     3424        );
    33583425        if ( 'application/ld+json' === $type ) {
    33593426            $settings['codemirror']['mode']['jsonld'] = true;
     
    33623429        }
    33633430    } elseif ( false !== strpos( $type, 'jsx' ) ) {
    3364         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3365             'mode' => 'jsx',
    3366             'autoCloseBrackets' => true,
    3367             'matchBrackets' => true,
    3368         ) );
     3431        $settings['codemirror'] = array_merge(
     3432            $settings['codemirror'], array(
     3433                'mode'              => 'jsx',
     3434                'autoCloseBrackets' => true,
     3435                'matchBrackets'     => true,
     3436            )
     3437        );
    33693438    } elseif ( 'text/x-markdown' === $type ) {
    3370         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3371             'mode' => 'markdown',
    3372             'highlightFormatting' => true,
    3373         ) );
     3439        $settings['codemirror'] = array_merge(
     3440            $settings['codemirror'], array(
     3441                'mode'                => 'markdown',
     3442                'highlightFormatting' => true,
     3443            )
     3444        );
    33743445    } elseif ( 'text/nginx' === $type ) {
    3375         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3376             'mode' => 'nginx',
    3377         ) );
     3446        $settings['codemirror'] = array_merge(
     3447            $settings['codemirror'], array(
     3448                'mode' => 'nginx',
     3449            )
     3450        );
    33783451    } elseif ( 'application/x-httpd-php' === $type ) {
    3379         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3380             'mode' => 'php',
    3381             'autoCloseBrackets' => true,
    3382             'autoCloseTags' => true,
    3383             'matchBrackets' => true,
    3384             'matchTags' => array(
    3385                 'bothTags' => true,
    3386             ),
    3387         ) );
     3452        $settings['codemirror'] = array_merge(
     3453            $settings['codemirror'], array(
     3454                'mode'              => 'php',
     3455                'autoCloseBrackets' => true,
     3456                'autoCloseTags'     => true,
     3457                'matchBrackets'     => true,
     3458                'matchTags'         => array(
     3459                    'bothTags' => true,
     3460                ),
     3461            )
     3462        );
    33883463    } elseif ( 'text/x-sql' === $type || 'text/x-mysql' === $type ) {
    3389         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3390             'mode' => 'sql',
    3391             'autoCloseBrackets' => true,
    3392             'matchBrackets' => true,
    3393         ) );
     3464        $settings['codemirror'] = array_merge(
     3465            $settings['codemirror'], array(
     3466                'mode'              => 'sql',
     3467                'autoCloseBrackets' => true,
     3468                'matchBrackets'     => true,
     3469            )
     3470        );
    33943471    } elseif ( false !== strpos( $type, 'xml' ) ) {
    3395         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3396             'mode' => 'xml',
    3397             'autoCloseBrackets' => true,
    3398             'autoCloseTags' => true,
    3399             'matchTags' => array(
    3400                 'bothTags' => true,
    3401             ),
    3402         ) );
     3472        $settings['codemirror'] = array_merge(
     3473            $settings['codemirror'], array(
     3474                'mode'              => 'xml',
     3475                'autoCloseBrackets' => true,
     3476                'autoCloseTags'     => true,
     3477                'matchTags'         => array(
     3478                    'bothTags' => true,
     3479                ),
     3480            )
     3481        );
    34033482    } elseif ( 'text/x-yaml' === $type ) {
    3404         $settings['codemirror'] = array_merge( $settings['codemirror'], array(
    3405             'mode' => 'yaml',
    3406         ) );
     3483        $settings['codemirror'] = array_merge(
     3484            $settings['codemirror'], array(
     3485                'mode' => 'yaml',
     3486            )
     3487        );
    34073488    } else {
    34083489        $settings['codemirror']['mode'] = $type;
     
    35163597 *
    35173598 * @param bool $escaped Whether the result is escaped. Default true.
    3518  *                      Only use when you are later escaping it. Do not use unescaped.
     3599 *                      Only use when you are later escaping it. Do not use unescaped.
    35193600 * @return string
    35203601 */
     
    35293610    $query = apply_filters( 'get_search_query', get_query_var( 's' ) );
    35303611
    3531     if ( $escaped )
     3612    if ( $escaped ) {
    35323613        $query = esc_attr( $query );
     3614    }
    35333615    return $query;
    35343616}
     
    35663648    $attributes = array();
    35673649
    3568     if ( function_exists( 'is_rtl' ) && is_rtl() )
     3650    if ( function_exists( 'is_rtl' ) && is_rtl() ) {
    35693651        $attributes[] = 'dir="rtl"';
     3652    }
    35703653
    35713654    if ( $lang = get_bloginfo( 'language' ) ) {
     
    35793662    }
    35803663
    3581     $output = implode(' ', $attributes);
     3664    $output = implode( ' ', $attributes );
    35823665
    35833666    /**
     
    37323815    if ( isset( $url_parts[1] ) ) {
    37333816        // Find the format argument.
    3734         $format = explode( '?', str_replace( '%_%', $args['format'], $args['base'] ) );
     3817        $format       = explode( '?', str_replace( '%_%', $args['format'], $args['base'] ) );
    37353818        $format_query = isset( $format[1] ) ? $format[1] : '';
    37363819        wp_parse_str( $format_query, $format_args );
     
    37613844        $mid_size = 2;
    37623845    }
    3763     $add_args = $args['add_args'];
    3764     $r = '';
     3846    $add_args   = $args['add_args'];
     3847    $r          = '';
    37653848    $page_links = array();
    3766     $dots = false;
     3849    $dots       = false;
    37673850
    37683851    if ( $args['prev_next'] && $current && 1 < $current ) :
    37693852        $link = str_replace( '%_%', 2 == $current ? '' : $args['format'], $args['base'] );
    37703853        $link = str_replace( '%#%', $current - 1, $link );
    3771         if ( $add_args )
     3854        if ( $add_args ) {
    37723855            $link = add_query_arg( $add_args, $link );
     3856        }
    37733857        $link .= $args['add_fragment'];
    37743858
     
    37843868    for ( $n = 1; $n <= $total; $n++ ) :
    37853869        if ( $n == $current ) :
    3786             $page_links[] = "<span aria-current='" . esc_attr( $args['aria_current'] ) . "' class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</span>";
    3787             $dots = true;
     3870            $page_links[] = "<span aria-current='" . esc_attr( $args['aria_current'] ) . "' class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</span>';
     3871            $dots         = true;
    37883872        else :
    37893873            if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
    37903874                $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
    37913875                $link = str_replace( '%#%', $n, $link );
    3792                 if ( $add_args )
     3876                if ( $add_args ) {
    37933877                    $link = add_query_arg( $add_args, $link );
     3878                }
    37943879                $link .= $args['add_fragment'];
    37953880
    37963881                /** This filter is documented in wp-includes/general-template.php */
    3797                 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</a>";
    3798                 $dots = true;
     3882                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . '</a>';
     3883                $dots         = true;
    37993884            elseif ( $dots && ! $args['show_all'] ) :
    38003885                $page_links[] = '<span class="page-numbers dots">' . __( '&hellip;' ) . '</span>';
    3801                 $dots = false;
     3886                $dots         = false;
    38023887            endif;
    38033888        endif;
     
    38063891        $link = str_replace( '%_%', $args['format'], $args['base'] );
    38073892        $link = str_replace( '%#%', $current + 1, $link );
    3808         if ( $add_args )
     3893        if ( $add_args ) {
    38093894            $link = add_query_arg( $add_args, $link );
     3895        }
    38103896        $link .= $args['add_fragment'];
    38113897
     
    38143900    endif;
    38153901    switch ( $args['type'] ) {
    3816         case 'array' :
     3902        case 'array':
    38173903            return $page_links;
    38183904
    3819         case 'list' :
     3905        case 'list':
    38203906            $r .= "<ul class='page-numbers'>\n\t<li>";
    3821             $r .= join("</li>\n\t<li>", $page_links);
     3907            $r .= join( "</li>\n\t<li>", $page_links );
    38223908            $r .= "</li>\n</ul>\n";
    38233909            break;
    38243910
    3825         default :
    3826             $r = join("\n", $page_links);
     3911        default:
     3912            $r = join( "\n", $page_links );
    38273913            break;
    38283914    }
     
    38593945    global $_wp_admin_css_colors;
    38603946
    3861     if ( !isset($_wp_admin_css_colors) )
     3947    if ( ! isset( $_wp_admin_css_colors ) ) {
    38623948        $_wp_admin_css_colors = array();
    3863 
    3864     $_wp_admin_css_colors[$key] = (object) array(
    3865         'name' => $name,
    3866         'url' => $url,
    3867         'colors' => $colors,
     3949    }
     3950
     3951    $_wp_admin_css_colors[ $key ] = (object) array(
     3952        'name'        => $name,
     3953        'url'         => $url,
     3954        'colors'      => $colors,
    38683955        'icon_colors' => $icons,
    38693956    );
     
    38763963 */
    38773964function register_admin_color_schemes() {
    3878     $suffix = is_rtl() ? '-rtl' : '';
     3965    $suffix  = is_rtl() ? '-rtl' : '';
    38793966    $suffix .= SCRIPT_DEBUG ? '' : '.min';
    38803967
    3881     wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
     3968    wp_admin_css_color(
     3969        'fresh', _x( 'Default', 'admin color scheme' ),
    38823970        false,
    38833971        array( '#222', '#333', '#0073aa', '#00a0d2' ),
    3884         array( 'base' => '#82878c', 'focus' => '#00a0d2', 'current' => '#fff' )
     3972        array(
     3973            'base'    => '#82878c',
     3974            'focus'   => '#00a0d2',
     3975            'current' => '#fff',
     3976        )
    38853977    );
    38863978
     
    38903982    }
    38913983
    3892     wp_admin_css_color( 'light', _x( 'Light', 'admin color scheme' ),
     3984    wp_admin_css_color(
     3985        'light', _x( 'Light', 'admin color scheme' ),
    38933986        admin_url( "css/colors/light/colors$suffix.css" ),
    38943987        array( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),
    3895         array( 'base' => '#999', 'focus' => '#ccc', 'current' => '#ccc' )
     3988        array(
     3989            'base'    => '#999',
     3990            'focus'   => '#ccc',
     3991            'current' => '#ccc',
     3992        )
    38963993    );
    38973994
    3898     wp_admin_css_color( 'blue', _x( 'Blue', 'admin color scheme' ),
     3995    wp_admin_css_color(
     3996        'blue', _x( 'Blue', 'admin color scheme' ),
    38993997        admin_url( "css/colors/blue/colors$suffix.css" ),
    39003998        array( '#096484', '#4796b3', '#52accc', '#74B6CE' ),
    3901         array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )
     3999        array(
     4000            'base'    => '#e5f8ff',
     4001            'focus'   => '#fff',
     4002            'current' => '#fff',
     4003        )
    39024004    );
    39034005
    3904     wp_admin_css_color( 'midnight', _x( 'Midnight', 'admin color scheme' ),
     4006    wp_admin_css_color(
     4007        'midnight', _x( 'Midnight', 'admin color scheme' ),
    39054008        admin_url( "css/colors/midnight/colors$suffix.css" ),
    39064009        array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
    3907         array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' )
     4010        array(
     4011            'base'    => '#f1f2f3',
     4012            'focus'   => '#fff',
     4013            'current' => '#fff',
     4014        )
    39084015    );
    39094016
    3910     wp_admin_css_color( 'sunrise', _x( 'Sunrise', 'admin color scheme' ),
     4017    wp_admin_css_color(
     4018        'sunrise', _x( 'Sunrise', 'admin color scheme' ),
    39114019        admin_url( "css/colors/sunrise/colors$suffix.css" ),
    39124020        array( '#b43c38', '#cf4944', '#dd823b', '#ccaf0b' ),
    3913         array( 'base' => '#f3f1f1', 'focus' => '#fff', 'current' => '#fff' )
     4021        array(
     4022            'base'    => '#f3f1f1',
     4023            'focus'   => '#fff',
     4024            'current' => '#fff',
     4025        )
    39144026    );
    39154027
    3916     wp_admin_css_color( 'ectoplasm', _x( 'Ectoplasm', 'admin color scheme' ),
     4028    wp_admin_css_color(
     4029        'ectoplasm', _x( 'Ectoplasm', 'admin color scheme' ),
    39174030        admin_url( "css/colors/ectoplasm/colors$suffix.css" ),
    39184031        array( '#413256', '#523f6d', '#a3b745', '#d46f15' ),
    3919         array( 'base' => '#ece6f6', 'focus' => '#fff', 'current' => '#fff' )
     4032        array(
     4033            'base'    => '#ece6f6',
     4034            'focus'   => '#fff',
     4035            'current' => '#fff',
     4036        )
    39204037    );
    39214038
    3922     wp_admin_css_color( 'ocean', _x( 'Ocean', 'admin color scheme' ),
     4039    wp_admin_css_color(
     4040        'ocean', _x( 'Ocean', 'admin color scheme' ),
    39234041        admin_url( "css/colors/ocean/colors$suffix.css" ),
    39244042        array( '#627c83', '#738e96', '#9ebaa0', '#aa9d88' ),
    3925         array( 'base' => '#f2fcff', 'focus' => '#fff', 'current' => '#fff' )
     4043        array(
     4044            'base'    => '#f2fcff',
     4045            'focus'   => '#fff',
     4046            'current' => '#fff',
     4047        )
    39264048    );
    39274049
    3928     wp_admin_css_color( 'coffee', _x( 'Coffee', 'admin color scheme' ),
     4050    wp_admin_css_color(
     4051        'coffee', _x( 'Coffee', 'admin color scheme' ),
    39294052        admin_url( "css/colors/coffee/colors$suffix.css" ),
    39304053        array( '#46403c', '#59524c', '#c7a589', '#9ea476' ),
    3931         array( 'base' => '#f3f2f1', 'focus' => '#fff', 'current' => '#fff' )
     4054        array(
     4055            'base'    => '#f3f2f1',
     4056            'focus'   => '#fff',
     4057            'current' => '#fff',
     4058        )
    39324059    );
    39334060
     
    39454072 */
    39464073function wp_admin_css_uri( $file = 'wp-admin' ) {
    3947     if ( defined('WP_INSTALLING') ) {
     4074    if ( defined( 'WP_INSTALLING' ) ) {
    39484075        $_file = "./$file.css";
    39494076    } else {
    3950         $_file = admin_url("$file.css");
    3951     }
    3952     $_file = add_query_arg( 'version', get_bloginfo( 'version' ),  $_file );
     4077        $_file = admin_url( "$file.css" );
     4078    }
     4079    $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file );
    39534080
    39544081    /**
     
    39804107 *
    39814108 * @param string $file       Optional. Style handle name or file name (without ".css" extension) relative
    3982  *                           to wp-admin/. Defaults to 'wp-admin'.
     4109 *                           to wp-admin/. Defaults to 'wp-admin'.
    39834110 * @param bool   $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
    39844111 */
     
    39884115
    39894116    if ( wp_styles()->query( $handle ) ) {
    3990         if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
     4117        if ( $force_echo || did_action( 'wp_print_styles' ) ) { // we already printed the style queue. Print this one immediately
    39914118            wp_print_styles( $handle );
    3992         else // Add to style queue
     4119        } else { // Add to style queue
    39934120            wp_enqueue_style( $handle );
     4121        }
    39944122        return;
    39954123    }
     
    40274155    wp_enqueue_style( 'thickbox' );
    40284156
    4029     if ( is_network_admin() )
     4157    if ( is_network_admin() ) {
    40304158        add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
     4159    }
    40314160}
    40324161
     
    40694198     *                               'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
    40704199     */
    4071     echo apply_filters( 'the_generator', get_the_generator($type), $type ) . "\n";
     4200    echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "\n";
    40724201}
    40734202
     
    40884217
    40894218        $current_filter = current_filter();
    4090         if ( empty( $current_filter ) )
     4219        if ( empty( $current_filter ) ) {
    40914220            return;
     4221        }
    40924222
    40934223        switch ( $current_filter ) {
    4094             case 'rss2_head' :
    4095             case 'commentsrss2_head' :
     4224            case 'rss2_head':
     4225            case 'commentsrss2_head':
    40964226                $type = 'rss2';
    40974227                break;
    4098             case 'rss_head' :
    4099             case 'opml_head' :
     4228            case 'rss_head':
     4229            case 'opml_head':
    41004230                $type = 'comment';
    41014231                break;
    4102             case 'rdf_header' :
     4232            case 'rdf_header':
    41034233                $type = 'rdf';
    41044234                break;
    4105             case 'atom_head' :
    4106             case 'comments_atom_head' :
    4107             case 'app_head' :
     4235            case 'atom_head':
     4236            case 'comments_atom_head':
     4237            case 'app_head':
    41084238                $type = 'atom';
    41094239                break;
     
    41314261            break;
    41324262        case 'export':
    4133             $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
     4263            $gen = '<!-- generator="WordPress/' . get_bloginfo_rss( 'version' ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
    41344264            break;
    41354265    }
     
    42284358 */
    42294359function __checked_selected_helper( $helper, $current, $echo, $type ) {
    4230     if ( (string) $helper === (string) $current )
     4360    if ( (string) $helper === (string) $current ) {
    42314361        $result = " $type='$type'";
    4232     else
     4362    } else {
    42334363        $result = '';
    4234 
    4235     if ( $echo )
     4364    }
     4365
     4366    if ( $echo ) {
    42364367        echo $result;
     4368    }
    42374369
    42384370    return $result;
     
    42504382 */
    42514383function wp_heartbeat_settings( $settings ) {
    4252     if ( ! is_admin() )
     4384    if ( ! is_admin() ) {
    42534385        $settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );
    4254 
    4255     if ( is_user_logged_in() )
     4386    }
     4387
     4388    if ( is_user_logged_in() ) {
    42564389        $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
     4390    }
    42574391
    42584392    return $settings;
Note: See TracChangeset for help on using the changeset viewer.