Ticket #54728: 54728.4.diff
File 54728.4.diff, 14.2 KB (added by , 3 years ago) |
---|
-
src/wp-includes/category-template.php
555 555 } 556 556 557 557 // Descendants of exclusions should be excluded too. 558 if ( true == $parsed_args['hierarchical'] ) {558 if ( true === $parsed_args['hierarchical'] ) { 559 559 $exclude_tree = array(); 560 560 561 561 if ( $parsed_args['exclude_tree'] ) { -
src/wp-includes/option.php
1091 1091 $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] ); 1092 1092 1093 1093 // No change or both empty. 1094 if ( $cookie == $settings ) {1094 if ( $cookie === $settings ) { 1095 1095 return; 1096 1096 } 1097 1097 -
src/wp-includes/category.php
149 149 foreach ( $categories as $category ) { 150 150 $path = '/' . $leaf_path; 151 151 $curcategory = $category; 152 while ( ( 0 != $curcategory->parent ) && ( $curcategory->parent != $curcategory->term_id ) ) {152 while ( ( 0 !== $curcategory->parent ) && ( $curcategory->parent !== $curcategory->term_id ) ) { 153 153 $curcategory = get_term( $curcategory->parent, 'category' ); 154 154 155 155 if ( is_wp_error( $curcategory ) ) { … … 159 159 $path = '/' . $curcategory->slug . $path; 160 160 } 161 161 162 if ( $path == $full_path ) {162 if ( $path === $full_path ) { 163 163 $category = get_term( $category->term_id, 'category', $output ); 164 164 _make_cat_compat( $category ); 165 165 -
src/wp-includes/taxonomy.php
2228 2228 if ( count( $taxonomies ) > 1 ) { 2229 2229 foreach ( $taxonomies as $index => $taxonomy ) { 2230 2230 $t = get_taxonomy( $taxonomy ); 2231 if ( isset( $t->args ) && is_array( $t->args ) && array_merge( $args, $t->args ) != $args ) {2231 if ( isset( $t->args ) && is_array( $t->args ) && array_merge( $args, $t->args ) !== $args ) { 2232 2232 unset( $taxonomies[ $index ] ); 2233 2233 $terms = array_merge( $terms, wp_get_object_terms( $object_ids, $taxonomy, array_merge( $args, $t->args ) ) ); 2234 2234 } … … 3465 3465 } 3466 3466 } 3467 3467 3468 if ( array_filter( $object_types, 'post_type_exists' ) == $object_types ) {3468 if ( array_filter( $object_types, 'post_type_exists' ) === $object_types ) { 3469 3469 // Only post types are attached to this taxonomy. 3470 3470 _update_post_term_count( $terms, $taxonomy ); 3471 3471 } else { -
src/wp-includes/rewrite.php
144 144 } 145 145 146 146 /** 147 * Add a new rewrite tag (like %postname%).147 * Adds a new rewrite tag (like %postname%). 148 148 * 149 149 * The `$query` parameter is optional. If it is omitted you must ensure that you call 150 150 * this on, or before, the {@see 'init'} hook. This is because `$query` defaults to … … 191 191 } 192 192 193 193 /** 194 * Add permalink structure.194 * Adds permalink structure. 195 195 * 196 196 * @since 3.0.0 197 197 * … … 210 210 if ( ! is_array( $args ) ) { 211 211 $args = array( 'with_front' => $args ); 212 212 } 213 if ( func_num_args() == 4 ) {213 if ( func_num_args() === 4 ) { 214 214 $args['ep_mask'] = func_get_arg( 3 ); 215 215 } 216 216 … … 237 237 } 238 238 239 239 /** 240 * Add a new feed type like /atom1/.240 * Adds a new feed type like /atom1/. 241 241 * 242 242 * @since 2.1.0 243 243 * … … 265 265 } 266 266 267 267 /** 268 * Remove rewrite rules and then recreate rewrite rules.268 * Removes rewrite rules and then recreate rewrite rules. 269 269 * 270 270 * @since 3.0.0 271 271 * … … 283 283 } 284 284 285 285 /** 286 * Add an endpoint, like /trackback/.286 * Adds an endpoint, like /trackback/. 287 287 * 288 288 * Adding an endpoint creates extra rewrite rules for each of the matching 289 289 * places specified by the provided bitmask. For example: … … 357 357 358 358 359 359 /** 360 * Resolve numeric slugs that collide with date permalinks.360 * Resolves numeric slugs that collide with date permalinks. 361 361 * 362 362 * Permalinks of posts with numeric slugs can sometimes look to WP_Query::parse_query() 363 363 * like a date archive, as when your permalink structure is `/%year%/%postname%/` and … … 473 473 } 474 474 475 475 /** 476 * Examine a URL and try to determine the post ID it represents.476 * Examines a URL and try to determine the post ID it represents. 477 477 * 478 478 * Checks are supposedly from the hosted site blog. 479 479 * … … 584 584 585 585 // If the requesting file is the anchor of the match, 586 586 // prepend it to the path info. 587 if ( ! empty( $url ) && ( $url != $request ) && ( strpos( $match, $url ) === 0 ) ) {587 if ( ! empty( $url ) && ( $url !== $request ) && ( strpos( $match, $url ) === 0 ) ) { 588 588 $request_match = $url . '/' . $request; 589 589 } 590 590 -
src/wp-includes/post-template.php
9 9 */ 10 10 11 11 /** 12 * Display the ID of the current item in the WordPress Loop.12 * Displays the ID of the current item in the WordPress Loop. 13 13 * 14 14 * @since 0.71 15 15 */ … … 18 18 } 19 19 20 20 /** 21 * Retrieve the ID of the current item in the WordPress Loop.21 * Retrieves the ID of the current item in the WordPress Loop. 22 22 * 23 23 * @since 2.1.0 24 24 * … … 30 30 } 31 31 32 32 /** 33 * Display or retrieve the current post title with optional markup.33 * Displays or retrieve the current post title with optional markup. 34 34 * 35 35 * @since 0.71 36 36 * … … 42 42 function the_title( $before = '', $after = '', $echo = true ) { 43 43 $title = get_the_title(); 44 44 45 if ( strlen( $title ) == 0 ) {45 if ( strlen( $title ) === 0 ) { 46 46 return; 47 47 } 48 48 … … 56 56 } 57 57 58 58 /** 59 * Sanitize the current title when retrieving or displaying.59 * Sanitizes the current title when retrieving or displaying. 60 60 * 61 61 * Works like the_title(), except the parameters can be in a string or 62 62 * an array. See the function for what can be override in the $args parameter. … … 88 88 89 89 $title = get_the_title( $parsed_args['post'] ); 90 90 91 if ( strlen( $title ) == 0 ) {91 if ( strlen( $title ) === 0 ) { 92 92 return; 93 93 } 94 94 … … 103 103 } 104 104 105 105 /** 106 * Retrieve post title.106 * Retrieves post title. 107 107 * 108 108 * If the post is protected and the visitor is not an admin, then "Protected" 109 109 * will be displayed before the post title. If the post is private, then … … 172 172 } 173 173 174 174 /** 175 * Display the Post Global Unique Identifier (guid).175 * Displays the Post Global Unique Identifier (guid). 176 176 * 177 177 * The guid will appear to be a link, but should not be used as a link to the 178 178 * post. The reason you should not use it as a link, is because of moving the … … 204 204 } 205 205 206 206 /** 207 * Retrieve the Post Global Unique Identifier (guid).207 * Retrieves the Post Global Unique Identifier (guid). 208 208 * 209 209 * The guid will appear to be a link, but should not be used as an link to the 210 210 * post. The reason you should not use it as a link, is because of moving the … … 233 233 } 234 234 235 235 /** 236 * Display the post content.236 * Displays the post content. 237 237 * 238 238 * @since 0.71 239 239 * … … 256 256 } 257 257 258 258 /** 259 * Retrieve the post content.259 * Retrieves the post content. 260 260 * 261 261 * @since 0.71 262 262 * @since 5.2.0 Added the `$post` parameter. … … 340 340 $content = array( $content ); 341 341 } 342 342 343 if ( false !== strpos( $_post->post_content, '<!--noteaser-->' ) && ( ! $elements['multipage'] || 1 == $elements['page'] ) ) {343 if ( false !== strpos( $_post->post_content, '<!--noteaser-->' ) && ( ! $elements['multipage'] || 1 === $elements['page'] ) ) { 344 344 $strip_teaser = true; 345 345 } 346 346 … … 376 376 } 377 377 378 378 /** 379 * Display the post excerpt.379 * Displays the post excerpt. 380 380 * 381 381 * @since 0.71 382 382 */ … … 957 957 $output .= $parsed_args['before']; 958 958 for ( $i = 1; $i <= $numpages; $i++ ) { 959 959 $link = $parsed_args['link_before'] . str_replace( '%', $i, $parsed_args['pagelink'] ) . $parsed_args['link_after']; 960 if ( $i != $page || ! $more && 1== $page ) {960 if ( $i !== $page || ! $more && 1 === $page ) { 961 961 $link = _wp_link_page( $i ) . $link . '</a>'; 962 962 } elseif ( $i === $page ) { 963 963 $link = '<span class="post-page-numbers current" aria-current="' . esc_attr( $parsed_args['aria_current'] ) . '">' . $link . '</span>'; … … 1033 1033 $post = get_post(); 1034 1034 $query_args = array(); 1035 1035 1036 if ( 1 == $i ) {1036 if ( 1 === $i ) { 1037 1037 $url = get_permalink(); 1038 1038 } else { 1039 1039 if ( ! get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ), true ) ) { 1040 1040 $url = add_query_arg( 'page', $i, get_permalink() ); 1041 } elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {1041 } elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) === $post->ID ) { 1042 1042 $url = trailingslashit( get_permalink() ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $i, 'single_paged' ); 1043 1043 } else { 1044 1044 $url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' ); … … 1063 1063 // 1064 1064 1065 1065 /** 1066 * Retrieve post custom meta data field.1066 * Retrieves post custom meta data field. 1067 1067 * 1068 1068 * @since 1.5.0 1069 1069 * … … 1084 1084 } 1085 1085 1086 1086 /** 1087 * Display a list of post custom fields.1087 * Displays a list of post custom fields. 1088 1088 * 1089 1089 * @since 1.2.0 1090 1090 * … … 1133 1133 // 1134 1134 1135 1135 /** 1136 * Retrieve or display a list of pages as a dropdown (select list).1136 * Retrieves or display a list of pages as a dropdown (select list). 1137 1137 * 1138 1138 * @since 2.1.0 1139 1139 * @since 4.2.0 The `$value_field` argument was added. … … 1224 1224 } 1225 1225 1226 1226 /** 1227 * Retrieve or display a list of pages (or hierarchical post type items) in list (li) format.1227 * Retrieves or display a list of pages (or hierarchical post type items) in list (li) format. 1228 1228 * 1229 1229 * @since 1.5.0 1230 1230 * @since 4.7.0 Added the `item_spacing` argument. … … 1513 1513 // 1514 1514 1515 1515 /** 1516 * Retrieve HTML list content for page list.1516 * Retrieves HTML list content for page list. 1517 1517 * 1518 1518 * @uses Walker_Page to create HTML list content. 1519 1519 * @since 2.1.0 … … 1544 1544 } 1545 1545 1546 1546 /** 1547 * Retrieve HTML dropdown (select) content for page list.1547 * Retrieves HTML dropdown (select) content for page list. 1548 1548 * 1549 1549 * @since 2.1.0 1550 1550 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it … … 1574 1574 // 1575 1575 1576 1576 /** 1577 * Display an attachment page link using an image or icon.1577 * Displays an attachment page link using an image or icon. 1578 1578 * 1579 1579 * @since 2.0.0 1580 1580 * … … 1596 1596 } 1597 1597 1598 1598 /** 1599 * Retrieve an attachment page link using an image or icon, if possible.1599 * Retrieves an attachment page link using an image or icon, if possible. 1600 1600 * 1601 1601 * @since 2.5.0 1602 1602 * @since 4.4.0 The `$id` parameter can now accept either a post ID or `WP_Post` object. … … 1658 1658 } 1659 1659 1660 1660 /** 1661 * Wrap attachment in paragraph tag before content.1661 * Wraps attachment in paragraph tag before content. 1662 1662 * 1663 1663 * @since 2.0.0 1664 1664 * … … 1711 1711 // 1712 1712 1713 1713 /** 1714 * Retrieve protected post password form content.1714 * Retrieves protected post password form content. 1715 1715 * 1716 1716 * @since 1.0.0 1717 1717 * … … 1771 1771 return (bool) $page_template; 1772 1772 } 1773 1773 1774 if ( $template == $page_template ) {1774 if ( $template === $page_template ) { 1775 1775 return true; 1776 1776 } 1777 1777 … … 1813 1813 } 1814 1814 1815 1815 /** 1816 * Retrieve formatted date timestamp of a revision (linked to that revisions's page).1816 * Retrieves formatted date timestamp of a revision (linked to that revisions's page). 1817 1817 * 1818 1818 * @since 2.6.0 1819 1819 * … … 1854 1854 } 1855 1855 1856 1856 /** 1857 * Retrieve formatted date timestamp of a revision (linked to that revisions's page).1857 * Retrieves formatted date timestamp of a revision (linked to that revisions's page). 1858 1858 * 1859 1859 * @since 3.6.0 1860 1860 * … … 1918 1918 } 1919 1919 1920 1920 /** 1921 * Display a list of a post's revisions.1921 * Displays a list of a post's revisions. 1922 1922 * 1923 1923 * Can output either a UL with edit links or a TABLE with diff interface, and 1924 1924 * restore action links. -
src/wp-includes/class-wp-simplepie-file.php
56 56 $args['headers'] = $this->headers; 57 57 } 58 58 59 if ( SIMPLEPIE_USERAGENT != $this->useragent ) { // Use default WP user agent unless custom has been specified.59 if ( SIMPLEPIE_USERAGENT !== $this->useragent ) { // Use default WP user agent unless custom has been specified. 60 60 $args['user-agent'] = $this->useragent; 61 61 } 62 62 -
src/wp-includes/class-wp-rewrite.php
1398 1398 // Extra permastructs. 1399 1399 foreach ( $this->extra_permastructs as $permastructname => $struct ) { 1400 1400 if ( is_array( $struct ) ) { 1401 if ( count( $struct ) == 2 ) {1401 if ( count( $struct ) === 2 ) { 1402 1402 $rules = $this->generate_rewrite_rules( $struct[0], $struct[1] ); 1403 1403 } else { 1404 1404 $rules = $this->generate_rewrite_rules( $struct['struct'], $struct['ep_mask'], $struct['paged'], $struct['feed'], $struct['forcomments'], $struct['walk_dirs'], $struct['endpoints'] ); … … 1662 1662 $index = false === strpos( $query, '?' ) ? strlen( $query ) : strpos( $query, '?' ); 1663 1663 $front = substr( $query, 0, $index ); 1664 1664 1665 $external = $front != $this->index;1665 $external = $front !== $this->index; 1666 1666 } 1667 1667 1668 1668 // "external" = it doesn't correspond to index.php. … … 1793 1793 if ( ! is_array( $args ) ) { 1794 1794 $args = array( 'with_front' => $args ); 1795 1795 } 1796 if ( func_num_args() == 4 ) {1796 if ( func_num_args() === 4 ) { 1797 1797 $args['ep_mask'] = func_get_arg( 3 ); 1798 1798 } 1799 1799 … … 1931 1931 * @param string $permalink_structure Permalink structure. 1932 1932 */ 1933 1933 public function set_permalink_structure( $permalink_structure ) { 1934 if ( $permalink_structure != $this->permalink_structure ) {1934 if ( $permalink_structure !== $this->permalink_structure ) { 1935 1935 $old_permalink_structure = $this->permalink_structure; 1936 1936 update_option( 'permalink_structure', $permalink_structure ); 1937 1937