Ticket #17182: general-template.diff
File general-template.diff, 4.4 KB (added by , 14 years ago) |
---|
-
wp-includes/general-template.php
28 28 if ( isset($name) ) 29 29 $templates[] = "header-{$name}.php"; 30 30 31 $templates[] = "header.php";31 $templates[] = 'header.php'; 32 32 33 33 // Backward compat code will be removed in a future release 34 34 if ('' == locate_template($templates, true)) … … 57 57 if ( isset($name) ) 58 58 $templates[] = "footer-{$name}.php"; 59 59 60 $templates[] = "footer.php";60 $templates[] = 'footer.php'; 61 61 62 62 // Backward compat code will be removed in a future release 63 63 if ('' == locate_template($templates, true)) … … 86 86 if ( isset($name) ) 87 87 $templates[] = "sidebar-{$name}.php"; 88 88 89 $templates[] = "sidebar.php";89 $templates[] = 'sidebar.php'; 90 90 91 91 // Backward compat code will be removed in a future release 92 92 if ('' == locate_template($templates, true)) … … 569 569 $my_year = substr($m, 0, 4); 570 570 $my_month = $wp_locale->get_month(substr($m, 4, 2)); 571 571 $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 : ''); 573 573 } 574 574 575 575 // If there's a year … … 843 843 else // custom 844 844 $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n"; 845 845 846 $link_html = apply_filters( "get_archives_link", $link_html );846 $link_html = apply_filters( 'get_archives_link', $link_html ); 847 847 848 848 return $link_html; 849 849 } … … 916 916 917 917 //filters 918 918 $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); 920 920 921 921 $output = ''; 922 922 … … 1016 1016 } 1017 1017 } 1018 1018 } 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 '; 1020 1020 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 1021 1021 $key = md5($query); 1022 1022 $cache = wp_cache_get( 'wp_get_archives' , 'general'); … … 1210 1210 $ak_title_separator = ', '; 1211 1211 1212 1212 $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 ' 1214 1214 ."FROM $wpdb->posts " 1215 1215 ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' " 1216 1216 ."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' " … … 1248 1248 $calendar_output .= '<td>'; 1249 1249 1250 1250 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>"; 1252 1252 else 1253 1253 $calendar_output .= $day; 1254 1254 $calendar_output .= '</td>'; … … 1990 1990 if ( $add_args ) 1991 1991 $link = add_query_arg( $add_args, $link ); 1992 1992 $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>'; 1994 1994 endif; 1995 1995 for ( $n = 1; $n <= $total; $n++ ) : 1996 1996 $n_display = number_format_i18n($n); … … 2007 2007 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>"; 2008 2008 $dots = true; 2009 2009 elseif ( $dots && !$show_all ) : 2010 $page_links[] = "<span class='page-numbers dots'>...</span>";2010 $page_links[] = '<span class="page-numbers dots">...</span>'; 2011 2011 $dots = false; 2012 2012 endif; 2013 2013 endif; … … 2018 2018 if ( $add_args ) 2019 2019 $link = add_query_arg( $add_args, $link ); 2020 2020 $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>'; 2022 2022 endif; 2023 2023 switch ( $type ) : 2024 2024 case 'array' :