Changeset 47808 for trunk/src/wp-includes/link-template.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r47557 r47808 132 132 ); 133 133 134 if ( is_object( $post ) && isset( $post->filter ) && 'sample' == $post->filter ) {134 if ( is_object( $post ) && isset( $post->filter ) && 'sample' === $post->filter ) { 135 135 $sample = true; 136 136 } else { … … 166 166 $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); 167 167 168 if ( '' !=$permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ), true ) ) {168 if ( $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ), true ) ) { 169 169 170 170 $category = ''; … … 621 621 622 622 $permalink = $wp_rewrite->get_feed_permastruct(); 623 if ( '' != $permalink ) { 623 624 if ( '' !== $permalink ) { 624 625 if ( false !== strpos( $feed, 'comments_' ) ) { 625 626 $feed = str_replace( 'comments_', '', $feed ); … … 682 683 $unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent; 683 684 684 if ( '' !=get_option( 'permalink_structure' ) ) {685 if ( get_option( 'permalink_structure' ) ) { 685 686 if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post_id ) { 686 687 $url = _get_page_link( $post_id ); … … 795 796 } 796 797 797 if ( '' ==$permalink_structure ) {798 if ( ! $permalink_structure ) { 798 799 $link = home_url( "?feed=$feed&author=" . $author_id ); 799 800 } else { … … 867 868 $permalink_structure = get_option( 'permalink_structure' ); 868 869 869 if ( '' ==$permalink_structure ) {870 if ( 'category' == $taxonomy ) {870 if ( ! $permalink_structure ) { 871 if ( 'category' === $taxonomy ) { 871 872 $link = home_url( "?feed=$feed&cat=$term_id" ); 872 } elseif ( 'post_tag' == $taxonomy ) {873 } elseif ( 'post_tag' === $taxonomy ) { 873 874 $link = home_url( "?feed=$feed&tag=$term->slug" ); 874 875 } else { … … 887 888 } 888 889 889 if ( 'category' == $taxonomy ) {890 if ( 'category' === $taxonomy ) { 890 891 /** 891 892 * Filters the category feed link. … … 897 898 */ 898 899 $link = apply_filters( 'category_feed_link', $link, $feed ); 899 } elseif ( 'post_tag' == $taxonomy ) {900 } elseif ( 'post_tag' === $taxonomy ) { 900 901 /** 901 902 * Filters the post tag feed link. … … 1365 1366 if ( 'revision' === $post->post_type ) { 1366 1367 $action = ''; 1367 } elseif ( 'display' == $context ) {1368 } elseif ( 'display' === $context ) { 1368 1369 $action = '&action=edit'; 1369 1370 } else { … … 2269 2270 $base = trailingslashit( get_bloginfo( 'url' ) ); 2270 2271 2271 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) {2272 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' !== $request ) ) { 2272 2273 $base .= $wp_rewrite->index . '/'; 2273 2274 } … … 2729 2730 2730 2731 // Make sure we get a string back. Plain is the next best thing. 2731 if ( isset( $args['type'] ) && 'array' == $args['type'] ) {2732 if ( isset( $args['type'] ) && 'array' === $args['type'] ) { 2732 2733 $args['type'] = 'plain'; 2733 2734 } … … 2824 2825 $result = get_permalink(); 2825 2826 2826 if ( 'newest' == get_option( 'default_comments_page' ) ) {2827 if ( 'newest' === get_option( 'default_comments_page' ) ) { 2827 2828 if ( $pagenum != $max_page ) { 2828 2829 if ( $wp_rewrite->using_permalinks() ) { … … 3111 3112 3112 3113 // Make sure we get a string back. Plain is the next best thing. 3113 if ( isset( $args['type'] ) && 'array' == $args['type'] ) {3114 if ( isset( $args['type'] ) && 'array' === $args['type'] ) { 3114 3115 $args['type'] = 'plain'; 3115 3116 } … … 3406 3407 if ( ! empty( $plugin ) && is_string( $plugin ) ) { 3407 3408 $folder = dirname( plugin_basename( $plugin ) ); 3408 if ( '.' != $folder ) {3409 if ( '.' !== $folder ) { 3409 3410 $url .= '/' . ltrim( $folder, '/' ); 3410 3411 } … … 3452 3453 $current_network = get_network(); 3453 3454 3454 if ( 'relative' == $scheme ) {3455 if ( 'relative' === $scheme ) { 3455 3456 $url = $current_network->path; 3456 3457 } else { … … 3502 3503 } 3503 3504 3504 if ( 'relative' == $scheme ) {3505 if ( 'relative' === $scheme ) { 3505 3506 $url = $current_network->path; 3506 3507 } else { … … 3646 3647 } 3647 3648 3648 if ( 'relative' == $scheme ) {3649 if ( 'relative' === $scheme ) { 3649 3650 $url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) ); 3650 3651 if ( '' !== $url && '/' === $url[0] ) { … … 3785 3786 $page = get_query_var( 'page', 0 ); 3786 3787 if ( $page >= 2 ) { 3787 if ( '' ==get_option( 'permalink_structure' ) ) {3788 if ( ! get_option( 'permalink_structure' ) ) { 3788 3789 $canonical_url = add_query_arg( 'page', $page, $canonical_url ); 3789 3790 } else { … … 3874 3875 3875 3876 $post_id = 0; 3876 if ( 'query' == $context && is_singular() ) {3877 if ( 'query' === $context && is_singular() ) { 3877 3878 $post_id = get_queried_object_id(); 3878 3879 $post = get_post( $post_id ); 3879 } elseif ( 'post' == $context ) {3880 } elseif ( 'post' === $context ) { 3880 3881 $post = get_post( $id ); 3881 3882 if ( ! empty( $post->ID ) ) {
Note: See TracChangeset
for help on using the changeset viewer.