Ticket #17182: general-template.diff

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

general-template string cleanup

Line 
1Index: wp-includes/general-template.php
2===================================================================
3--- wp-includes/general-template.php    (revision 17660)
4+++ wp-includes/general-template.php    (working copy)
5@@ -28,7 +28,7 @@
6        if ( isset($name) )
7                $templates[] = "header-{$name}.php";
8 
9-       $templates[] = "header.php";
10+       $templates[] = 'header.php';
11 
12        // Backward compat code will be removed in a future release
13        if ('' == locate_template($templates, true))
14@@ -57,7 +57,7 @@
15        if ( isset($name) )
16                $templates[] = "footer-{$name}.php";
17 
18-       $templates[] = "footer.php";
19+       $templates[] = 'footer.php';
20 
21        // Backward compat code will be removed in a future release
22        if ('' == locate_template($templates, true))
23@@ -86,7 +86,7 @@
24        if ( isset($name) )
25                $templates[] = "sidebar-{$name}.php";
26 
27-       $templates[] = "sidebar.php";
28+       $templates[] = 'sidebar.php';
29 
30        // Backward compat code will be removed in a future release
31        if ('' == locate_template($templates, true))
32@@ -569,7 +569,7 @@
33                $my_year = substr($m, 0, 4);
34                $my_month = $wp_locale->get_month(substr($m, 4, 2));
35                $my_day = intval(substr($m, 6, 2));
36-               $title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : "");
37+               $title = $my_year . ($my_month ? $t_sep . $my_month : '') . ($my_day ? $t_sep . $my_day : '');
38        }
39 
40        // If there's a year
41@@ -843,7 +843,7 @@
42        else // custom
43                $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
44 
45-       $link_html = apply_filters( "get_archives_link", $link_html );
46+       $link_html = apply_filters( 'get_archives_link', $link_html );
47 
48        return $link_html;
49 }
50@@ -916,7 +916,7 @@
51 
52        //filters
53        $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
54-       $join = apply_filters('getarchives_join', "", $r);
55+       $join = apply_filters('getarchives_join', '', $r);
56 
57        $output = '';
58 
59@@ -1016,7 +1016,7 @@
60                                }
61                }
62        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
63-               $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC ";
64+               $orderby = ('alpha' == $type) ? 'post_title ASC ' : 'post_date DESC ';
65                $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
66                $key = md5($query);
67                $cache = wp_cache_get( 'wp_get_archives' , 'general');
68@@ -1210,7 +1210,7 @@
69                $ak_title_separator = ', ';
70 
71        $ak_titles_for_day = array();
72-       $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom "
73+       $ak_post_titles = $wpdb->get_results('SELECT ID, post_title, DAYOFMONTH(post_date) as dom '
74                ."FROM $wpdb->posts "
75                ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
76                ."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
77@@ -1248,7 +1248,7 @@
78                        $calendar_output .= '<td>';
79 
80                if ( in_array($day, $daywithpost) ) // any posts today?
81-                               $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"" . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
82+                               $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . '" title="' . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
83                else
84                        $calendar_output .= $day;
85                $calendar_output .= '</td>';
86@@ -1990,7 +1990,7 @@
87                if ( $add_args )
88                        $link = add_query_arg( $add_args, $link );
89                $link .= $add_fragment;
90-               $page_links[] = "<a class='prev page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$prev_text</a>";
91+               $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . esc_html( $prev_text ) . '</a>';
92        endif;
93        for ( $n = 1; $n <= $total; $n++ ) :
94                $n_display = number_format_i18n($n);
95@@ -2007,7 +2007,7 @@
96                                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>";
97                                $dots = true;
98                        elseif ( $dots && !$show_all ) :
99-                               $page_links[] = "<span class='page-numbers dots'>...</span>";
100+                               $page_links[] = '<span class="page-numbers dots">...</span>';
101                                $dots = false;
102                        endif;
103                endif;
104@@ -2018,7 +2018,7 @@
105                if ( $add_args )
106                        $link = add_query_arg( $add_args, $link );
107                $link .= $add_fragment;
108-               $page_links[] = "<a class='next page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$next_text</a>";
109+               $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . esc_html( $next_text ) . '</a>';
110        endif;
111        switch ( $type ) :
112                case 'array' :