WordPress.org

Make WordPress Core

Ticket #17182: general-template.diff

File general-template.diff, 4.4 KB (added by niallkennedy, 7 years ago)

general-template string cleanup

  • wp-includes/general-template.php

     
    2828        if ( isset($name) )
    2929                $templates[] = "header-{$name}.php";
    3030
    31         $templates[] = "header.php";
     31        $templates[] = 'header.php';
    3232
    3333        // Backward compat code will be removed in a future release
    3434        if ('' == locate_template($templates, true))
     
    5757        if ( isset($name) )
    5858                $templates[] = "footer-{$name}.php";
    5959
    60         $templates[] = "footer.php";
     60        $templates[] = 'footer.php';
    6161
    6262        // Backward compat code will be removed in a future release
    6363        if ('' == locate_template($templates, true))
     
    8686        if ( isset($name) )
    8787                $templates[] = "sidebar-{$name}.php";
    8888
    89         $templates[] = "sidebar.php";
     89        $templates[] = 'sidebar.php';
    9090
    9191        // Backward compat code will be removed in a future release
    9292        if ('' == locate_template($templates, true))
     
    569569                $my_year = substr($m, 0, 4);
    570570                $my_month = $wp_locale->get_month(substr($m, 4, 2));
    571571                $my_day = intval(substr($m, 6, 2));
    572                 $title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : "");
     572                $title = $my_year . ($my_month ? $t_sep . $my_month : '') . ($my_day ? $t_sep . $my_day : '');
    573573        }
    574574
    575575        // If there's a year
     
    843843        else // custom
    844844                $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
    845845
    846         $link_html = apply_filters( "get_archives_link", $link_html );
     846        $link_html = apply_filters( 'get_archives_link', $link_html );
    847847
    848848        return $link_html;
    849849}
     
    916916
    917917        //filters
    918918        $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
    919         $join = apply_filters('getarchives_join', "", $r);
     919        $join = apply_filters('getarchives_join', '', $r);
    920920
    921921        $output = '';
    922922
     
    10161016                                }
    10171017                }
    10181018        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
    1019                 $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC ";
     1019                $orderby = ('alpha' == $type) ? 'post_title ASC ' : 'post_date DESC ';
    10201020                $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
    10211021                $key = md5($query);
    10221022                $cache = wp_cache_get( 'wp_get_archives' , 'general');
     
    12101210                $ak_title_separator = ', ';
    12111211
    12121212        $ak_titles_for_day = array();
    1213         $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom "
     1213        $ak_post_titles = $wpdb->get_results('SELECT ID, post_title, DAYOFMONTH(post_date) as dom '
    12141214                ."FROM $wpdb->posts "
    12151215                ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
    12161216                ."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
     
    12481248                        $calendar_output .= '<td>';
    12491249
    12501250                if ( in_array($day, $daywithpost) ) // any posts today?
    1251                                 $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"" . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
     1251                                $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . '" title="' . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
    12521252                else
    12531253                        $calendar_output .= $day;
    12541254                $calendar_output .= '</td>';
     
    19901990                if ( $add_args )
    19911991                        $link = add_query_arg( $add_args, $link );
    19921992                $link .= $add_fragment;
    1993                 $page_links[] = "<a class='prev page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$prev_text</a>";
     1993                $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . esc_html( $prev_text ) . '</a>';
    19941994        endif;
    19951995        for ( $n = 1; $n <= $total; $n++ ) :
    19961996                $n_display = number_format_i18n($n);
     
    20072007                                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>";
    20082008                                $dots = true;
    20092009                        elseif ( $dots && !$show_all ) :
    2010                                 $page_links[] = "<span class='page-numbers dots'>...</span>";
     2010                                $page_links[] = '<span class="page-numbers dots">...</span>';
    20112011                                $dots = false;
    20122012                        endif;
    20132013                endif;
     
    20182018                if ( $add_args )
    20192019                        $link = add_query_arg( $add_args, $link );
    20202020                $link .= $add_fragment;
    2021                 $page_links[] = "<a class='next page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$next_text</a>";
     2021                $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . esc_html( $next_text ) . '</a>';
    20222022        endif;
    20232023        switch ( $type ) :
    20242024                case 'array' :