Changeset 47122 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r47104 r47122 704 704 function get_bloginfo( $show = '', $filter = 'raw' ) { 705 705 switch ( $show ) { 706 case 'home': // DEPRECATED707 case 'siteurl': // D EPRECATED706 case 'home': // Deprecated. 707 case 'siteurl': // Deprecated. 708 708 _deprecated_argument( 709 709 __FUNCTION__, … … 1072 1072 1073 1073 /* 1074 * If we're on the blog page that is not the homepage or1075 * a single post of any post type, use the post title.1074 * If we're on the blog page that is not the homepage 1075 * or a single post of any post type, use the post title. 1076 1076 */ 1077 1077 } elseif ( is_home() || is_singular() ) { … … 1196 1196 $title = ''; 1197 1197 1198 $t_sep = '%WP_TITLE_SEP%'; // Temporary separator, for accurate flipping, if necessary 1199 1200 // If there is a post 1198 $t_sep = '%WP_TITLE_SEP%'; // Temporary separator, for accurate flipping, if necessary. 1199 1200 // If there is a post. 1201 1201 if ( is_single() || ( is_home() && ! is_front_page() ) || ( is_page() && ! is_front_page() ) ) { 1202 1202 $title = single_post_title( '', false ); 1203 1203 } 1204 1204 1205 // If there's a post type archive 1205 // If there's a post type archive. 1206 1206 if ( is_post_type_archive() ) { 1207 1207 $post_type = get_query_var( 'post_type' ); … … 1215 1215 } 1216 1216 1217 // If there's a category or tag 1217 // If there's a category or tag. 1218 1218 if ( is_category() || is_tag() ) { 1219 1219 $title = single_term_title( '', false ); 1220 1220 } 1221 1221 1222 // If there's a taxonomy 1222 // If there's a taxonomy. 1223 1223 if ( is_tax() ) { 1224 1224 $term = get_queried_object(); … … 1229 1229 } 1230 1230 1231 // If there's an author 1231 // If there's an author. 1232 1232 if ( is_author() && ! is_post_type_archive() ) { 1233 1233 $author = get_queried_object(); … … 1242 1242 } 1243 1243 1244 // If there's a month 1244 // If there's a month. 1245 1245 if ( is_archive() && ! empty( $m ) ) { 1246 1246 $my_year = substr( $m, 0, 4 ); … … 1250 1250 } 1251 1251 1252 // If there's a year 1252 // If there's a year. 1253 1253 if ( is_archive() && ! empty( $year ) ) { 1254 1254 $title = $year; … … 1261 1261 } 1262 1262 1263 // If it's a search 1263 // If it's a search. 1264 1264 if ( is_search() ) { 1265 1265 /* translators: 1: Separator, 2: Search query. */ … … 1267 1267 } 1268 1268 1269 // If it's a 404 page 1269 // If it's a 404 page. 1270 1270 if ( is_404() ) { 1271 1271 $title = __( 'Page not found' ); … … 1286 1286 $title_array = apply_filters( 'wp_title_parts', explode( $t_sep, $title ) ); 1287 1287 1288 // Determines position of the separator and direction of the breadcrumb 1289 if ( 'right' == $seplocation ) { // sep on right, so reverse the order1288 // Determines position of the separator and direction of the breadcrumb. 1289 if ( 'right' == $seplocation ) { // Separator on right, so reverse the order. 1290 1290 $title_array = array_reverse( $title_array ); 1291 1291 $title = implode( " $sep ", $title_array ) . $prefix; … … 1305 1305 $title = apply_filters( 'wp_title', $title, $sep, $seplocation ); 1306 1306 1307 // Send it out 1307 // Send it out. 1308 1308 if ( $display ) { 1309 1309 echo $title; … … 1748 1748 } elseif ( 'html' === $format ) { 1749 1749 $link_html = "\t<li>$before<a href='$url'$aria_current>$text</a>$after</li>\n"; 1750 } else { // custom1750 } else { // Custom. 1751 1751 $link_html = "\t$before<a href='$url'$aria_current>$text</a>$after\n"; 1752 1752 } … … 1851 1851 } 1852 1852 1853 // this is what will separate dates on weekly archive links1853 // This is what will separate dates on weekly archive links. 1854 1854 $archive_week_separator = '–'; 1855 1855 … … 2096 2096 $w = (int) $_GET['w']; 2097 2097 } 2098 // week_begins = 0 stands for Sunday 2098 // week_begins = 0 stands for Sunday. 2099 2099 $week_begins = (int) get_option( 'start_of_week' ); 2100 2100 2101 // Let's figure out when we are 2101 // Let's figure out when we are. 2102 2102 if ( ! empty( $monthnum ) && ! empty( $year ) ) { 2103 2103 $thismonth = zeroise( intval( $monthnum ), 2 ); 2104 2104 $thisyear = (int) $year; 2105 2105 } elseif ( ! empty( $w ) ) { 2106 // We need to get the month from MySQL 2106 // We need to get the month from MySQL. 2107 2107 $thisyear = (int) substr( $m, 0, 4 ); 2108 // it seems MySQL's weeks disagree with PHP's2108 // It seems MySQL's weeks disagree with PHP's. 2109 2109 $d = ( ( $w - 1 ) * 7 ) + 6; 2110 2110 $thismonth = $wpdb->get_var( "SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')" ); … … 2124 2124 $last_day = gmdate( 't', $unixmonth ); 2125 2125 2126 // Get the next and previous month and year with at least one post 2126 // Get the next and previous month and year with at least one post. 2127 2127 $previous = $wpdb->get_row( 2128 2128 "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year … … 2199 2199 $daywithpost = array(); 2200 2200 2201 // Get days with posts 2201 // Get days with posts. 2202 2202 $dayswithposts = $wpdb->get_results( 2203 2203 "SELECT DISTINCT DAYOFMONTH(post_date) … … 2213 2213 } 2214 2214 2215 // See how much we should pad in the beginning 2215 // See how much we should pad in the beginning. 2216 2216 $pad = calendar_week_mod( gmdate( 'w', $unixmonth ) - $week_begins ); 2217 2217 if ( 0 != $pad ) { … … 2237 2237 2238 2238 if ( in_array( $day, $daywithpost ) ) { 2239 // any posts today?2239 // Any posts today? 2240 2240 $date_format = gmdate( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) ); 2241 2241 /* translators: Post calendar label. %s: Date. */ … … 3340 3340 $wp_rich_edit = false; 3341 3341 3342 if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users3342 if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // Default to 'true' for logged out users. 3343 3343 if ( $is_safari ) { 3344 3344 $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); … … 3372 3372 */ 3373 3373 function wp_default_editor() { 3374 $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults3375 if ( wp_get_current_user() ) { // look for cookie3374 $r = user_can_richedit() ? 'tinymce' : 'html'; // Defaults. 3375 if ( wp_get_current_user() ) { // Look for cookie. 3376 3376 $ed = get_user_setting( 'editor', 'tinymce' ); 3377 3377 $r = ( in_array( $ed, array( 'tinymce', 'html', 'test' ) ) ) ? $ed : $r; … … 4095 4095 4096 4096 $defaults = array( 4097 'base' => $pagenum_link, // http://example.com/all_posts.php%_% : %_% is replaced by format (below) 4098 'format' => $format, // ?page=%#% : %#% is replaced by the page number 4097 'base' => $pagenum_link, // http://example.com/all_posts.php%_% : %_% is replaced by format (below). 4098 'format' => $format, // ?page=%#% : %#% is replaced by the page number. 4099 4099 'total' => $total, 4100 4100 'current' => $current, … … 4107 4107 'mid_size' => 2, 4108 4108 'type' => 'plain', 4109 'add_args' => array(), // array of query args to add4109 'add_args' => array(), // Array of query args to add. 4110 4110 'add_fragment' => '', 4111 4111 'before_page_number' => '', … … 4137 4137 } 4138 4138 4139 // Who knows what else people pass in $args 4139 // Who knows what else people pass in $args. 4140 4140 $total = (int) $args['total']; 4141 4141 if ( $total < 2 ) { … … 4143 4143 } 4144 4144 $current = (int) $args['current']; 4145 $end_size = (int) $args['end_size']; // Out of bounds? Make it the default.4145 $end_size = (int) $args['end_size']; // Out of bounds? Make it the default. 4146 4146 if ( $end_size < 1 ) { 4147 4147 $end_size = 1; … … 4314 4314 ); 4315 4315 4316 // Other color schemes are not available when running out of src 4316 // Other color schemes are not available when running out of src. 4317 4317 if ( false !== strpos( get_bloginfo( 'version' ), '-src' ) ) { 4318 4318 return;
Note: See TracChangeset
for help on using the changeset viewer.