Changeset 59599
- Timestamp:
- 01/12/2025 06:12:14 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r59597 r59599 6062 6062 $revparts = array_reverse( $parts ); 6063 6063 6064 $found id = 0;6064 $found_id = 0; 6065 6065 foreach ( (array) $pages as $page ) { 6066 if ( $page->post_name == $revparts[0] ) {6066 if ( $page->post_name === $revparts[0] ) { 6067 6067 $count = 0; 6068 6068 $p = $page; … … 6072 6072 * ensuring each matches the post ancestry. 6073 6073 */ 6074 while ( 0 != $p->post_parent && isset( $pages[ $p->post_parent ] ) ) {6074 while ( 0 !== (int) $p->post_parent && isset( $pages[ $p->post_parent ] ) ) { 6075 6075 ++$count; 6076 6076 $parent = $pages[ $p->post_parent ]; 6077 if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) {6077 if ( ! isset( $revparts[ $count ] ) || $parent->post_name !== $revparts[ $count ] ) { 6078 6078 break; 6079 6079 } … … 6081 6081 } 6082 6082 6083 if ( 0 == $p->post_parent && count( $revparts ) === $count + 1 && $p->post_name == $revparts[ $count ] ) { 6084 $foundid = $page->ID; 6085 if ( $page->post_type == $post_type ) { 6083 if ( 0 === (int) $p->post_parent 6084 && count( $revparts ) === $count + 1 6085 && $p->post_name === $revparts[ $count ] 6086 ) { 6087 $found_id = $page->ID; 6088 if ( $page->post_type === $post_type ) { 6086 6089 break; 6087 6090 } … … 6091 6094 6092 6095 // We cache misses as well as hits. 6093 wp_cache_set( $cache_key, $found id, 'post-queries' );6094 6095 if ( $found id ) {6096 return get_post( $found id, $output );6096 wp_cache_set( $cache_key, $found_id, 'post-queries' ); 6097 6098 if ( $found_id ) { 6099 return get_post( $found_id, $output ); 6097 6100 } 6098 6101
Note: See TracChangeset
for help on using the changeset viewer.