Changeset 47808 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r47506 r47808 194 194 195 195 if ( ( ! empty( $email ) ) && ( '@' !== $email ) ) { 196 $display = ( '' != $linktext ) ? $linktext : $email;196 $display = ( '' !== $linktext ) ? $linktext : $email; 197 197 $return = $before; 198 198 $return .= sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) ); … … 222 222 $author = get_comment_author( $comment ); 223 223 224 if ( empty( $url ) || 'http://' == $url ) {224 if ( empty( $url ) || 'http://' === $url ) { 225 225 $return = $author; 226 226 } else { … … 309 309 $id = 0; 310 310 if ( ! empty( $comment ) ) { 311 $author_url = ( 'http://' == $comment->comment_author_url ) ? '' : $comment->comment_author_url;311 $author_url = ( 'http://' === $comment->comment_author_url ) ? '' : $comment->comment_author_url; 312 312 $url = esc_url( $author_url, array( 'http', 'https' ) ); 313 313 $id = $comment->comment_ID; … … 377 377 function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { 378 378 $url = get_comment_author_url( $comment ); 379 $display = ( '' != $linktext ) ? $linktext : $url;379 $display = ( '' !== $linktext ) ? $linktext : $url; 380 380 $display = str_replace( 'http://www.', '', $display ); 381 381 $display = str_replace( 'http://', '', $display ); 382 382 383 if ( '/' == substr( $display, -1 ) ) {383 if ( '/' === substr( $display, -1 ) ) { 384 384 $display = substr( $display, 0, -1 ); 385 385 } … … 551 551 function get_comment_date( $format = '', $comment_ID = 0 ) { 552 552 $comment = get_comment( $comment_ID ); 553 if ( '' == $format ) { 553 554 if ( '' === $format ) { 554 555 $date = mysql2date( get_option( 'date_format' ), $comment->comment_date ); 555 556 } else { 556 557 $date = mysql2date( $format, $comment->comment_date ); 557 558 } 559 558 560 /** 559 561 * Filters the returned comment date. … … 1038 1040 1039 1041 $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date; 1040 if ( '' == $format ) { 1042 1043 if ( '' === $format ) { 1041 1044 $date = mysql2date( get_option( 'time_format' ), $comment_date, $translate ); 1042 1045 } else { … … 1081 1084 function get_comment_type( $comment_ID = 0 ) { 1082 1085 $comment = get_comment( $comment_ID ); 1083 if ( '' == $comment->comment_type ) { 1086 1087 if ( '' === $comment->comment_type ) { 1084 1088 $comment->comment_type = 'comment'; 1085 1089 } … … 1142 1146 */ 1143 1147 function get_trackback_url() { 1144 if ( '' !=get_option( 'permalink_structure' ) ) {1148 if ( get_option( 'permalink_structure' ) ) { 1145 1149 $tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' ); 1146 1150 } else { … … 1236 1240 1237 1241 $post_id = $_post ? $_post->ID : 0; 1238 $open = ( 'open' == $_post->comment_status );1242 $open = ( 'open' === $_post->comment_status ); 1239 1243 1240 1244 /** … … 1266 1270 1267 1271 $post_id = $_post ? $_post->ID : 0; 1268 $open = ( 'open' == $_post->ping_status );1272 $open = ( 'open' === $_post->ping_status ); 1269 1273 1270 1274 /** … … 1506 1510 1507 1511 $overridden_cpage = false; 1512 1508 1513 if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) { 1509 set_query_var( 'cpage', 'newest' == get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );1514 set_query_var( 'cpage', 'newest' === get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 ); 1510 1515 $overridden_cpage = true; 1511 1516 } … … 1516 1521 1517 1522 $theme_template = STYLESHEETPATH . $file; 1523 1518 1524 /** 1519 1525 * Filters the path to the theme template file used for the comments template. … … 1524 1530 */ 1525 1531 $include = apply_filters( 'comments_template', $theme_template ); 1532 1526 1533 if ( file_exists( $include ) ) { 1527 1534 require $include; … … 2061 2068 return; 2062 2069 } 2063 if ( 'all' != $parsed_args['type'] ) {2070 if ( 'all' !== $parsed_args['type'] ) { 2064 2071 $comments_by_type = separate_comments( $comments ); 2065 2072 if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) { … … 2102 2109 $comments = get_comments( $comment_args ); 2103 2110 2104 if ( 'all' != $parsed_args['type'] ) {2111 if ( 'all' !== $parsed_args['type'] ) { 2105 2112 $comments_by_type = separate_comments( $comments ); 2106 2113 if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) { … … 2119 2126 return; 2120 2127 } 2121 if ( 'all' != $parsed_args['type'] ) {2128 if ( 'all' !== $parsed_args['type'] ) { 2122 2129 if ( empty( $wp_query->comments_by_type ) ) { 2123 2130 $wp_query->comments_by_type = separate_comments( $wp_query->comments ); … … 2175 2182 } else { 2176 2183 $threaded = ( -1 != $parsed_args['max_depth'] ); 2177 $parsed_args['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $parsed_args['per_page'], $threaded ) : 1;2184 $parsed_args['page'] = ( 'newest' === get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $parsed_args['per_page'], $threaded ) : 1; 2178 2185 set_query_var( 'cpage', $parsed_args['page'] ); 2179 2186 } … … 2186 2193 2187 2194 if ( null === $parsed_args['reverse_top_level'] ) { 2188 $parsed_args['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );2195 $parsed_args['reverse_top_level'] = ( 'desc' === get_option( 'comment_order' ) ); 2189 2196 } 2190 2197
Note: See TracChangeset
for help on using the changeset viewer.