Changeset 47808 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r47557 r47808 254 254 255 255 $search_form_template = locate_template( 'searchform.php' ); 256 if ( '' != $search_form_template ) { 256 257 if ( '' !== $search_form_template ) { 257 258 ob_start(); 258 259 require $search_form_template; … … 269 270 $aria_label = ''; 270 271 } 271 if ( 'html5' == $format ) {272 if ( 'html5' === $format ) { 272 273 $form = '<form role="search" ' . $aria_label . 'method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '"> 273 274 <label> … … 763 764 case 'charset': 764 765 $output = get_option( 'blog_charset' ); 765 if ( '' == $output ) {766 if ( '' === $output ) { 766 767 $output = 'UTF-8'; 767 768 } … … 817 818 } 818 819 819 if ( 'display' == $filter ) {820 if ( 'display' === $filter ) { 820 821 if ( $url ) { 821 822 /** … … 1287 1288 1288 1289 // Determines position of the separator and direction of the breadcrumb. 1289 if ( 'right' == $seplocation ) { // Separator on right, so reverse the order.1290 if ( 'right' === $seplocation ) { // Separator on right, so reverse the order. 1290 1291 $title_array = array_reverse( $title_array ); 1291 1292 $title = implode( " $sep ", $title_array ) . $prefix; … … 1835 1836 return; 1836 1837 } 1838 1837 1839 $parsed_args['post_type'] = $post_type_object->name; 1838 1840 1839 if ( '' == $parsed_args['type'] ) {1841 if ( '' === $parsed_args['type'] ) { 1840 1842 $parsed_args['type'] = 'monthly'; 1841 1843 } … … 1882 1884 $limit = $parsed_args['limit']; 1883 1885 1884 if ( 'monthly' == $parsed_args['type'] ) {1886 if ( 'monthly' === $parsed_args['type'] ) { 1885 1887 $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"; 1886 1888 $key = md5( $query ); … … 1907 1909 } 1908 1910 } 1909 } elseif ( 'yearly' == $parsed_args['type'] ) {1911 } elseif ( 'yearly' === $parsed_args['type'] ) { 1910 1912 $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"; 1911 1913 $key = md5( $query ); … … 1931 1933 } 1932 1934 } 1933 } elseif ( 'daily' == $parsed_args['type'] ) {1935 } elseif ( 'daily' === $parsed_args['type'] ) { 1934 1936 $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"; 1935 1937 $key = md5( $query ); … … 1956 1958 } 1957 1959 } 1958 } elseif ( 'weekly' == $parsed_args['type'] ) {1960 } elseif ( 'weekly' === $parsed_args['type'] ) { 1959 1961 $week = _wp_mysql_week( '`post_date`' ); 1960 1962 $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"; … … 1995 1997 } 1996 1998 } 1997 } elseif ( ( 'postbypost' == $parsed_args['type'] ) || ( 'alpha'== $parsed_args['type'] ) ) {1998 $orderby = ( 'alpha' == $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';1999 } elseif ( ( 'postbypost' === $parsed_args['type'] ) || ( 'alpha' === $parsed_args['type'] ) ) { 2000 $orderby = ( 'alpha' === $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC '; 1999 2001 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; 2000 2002 $key = md5( $query ); … … 2403 2405 } 2404 2406 2405 if ( '' == $format ) {2407 if ( '' === $format ) { 2406 2408 $the_date = get_post_time( get_option( 'date_format' ), false, $post, true ); 2407 2409 } else { … … 2532 2534 } 2533 2535 2534 if ( '' == $format ) {2536 if ( '' === $format ) { 2535 2537 $the_time = get_post_time( get_option( 'time_format' ), false, $post, true ); 2536 2538 } else { … … 3343 3345 $wp_rich_edit = false; 3344 3346 3345 if ( get_user_option( 'rich_editing' ) == 'true'|| ! is_user_logged_in() ) { // Default to 'true' for logged out users.3347 if ( 'true' === get_user_option( 'rich_editing' ) || ! is_user_logged_in() ) { // Default to 'true' for logged out users. 3346 3348 if ( $is_safari ) { 3347 3349 $wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
Note: See TracChangeset
for help on using the changeset viewer.