Coding Standards: Use strict comparison in get_post_ancestors().

Follow-up to [7074], [15758], [21559], [21953].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59566


git-svn-id: http://core.svn.wordpress.org/trunk@58952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-12-30 09:32:20 +00:00
parent b8fa6385d0
commit 54aeb1d515
2 changed files with 5 additions and 3 deletions

View File

@ -1135,7 +1135,7 @@ function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) {
function get_post_ancestors( $post ) {
$post = get_post( $post );
if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID ) {
if ( ! $post || empty( $post->post_parent ) || $post->post_parent === $post->ID ) {
return array();
}
@ -1146,7 +1146,9 @@ function get_post_ancestors( $post ) {
while ( $ancestor = get_post( $id ) ) {
// Loop detection: If the ancestor has been seen before, break.
if ( empty( $ancestor->post_parent ) || ( $ancestor->post_parent == $post->ID ) || in_array( $ancestor->post_parent, $ancestors, true ) ) {
if ( empty( $ancestor->post_parent ) || $ancestor->post_parent === $post->ID
|| in_array( $ancestor->post_parent, $ancestors, true )
) {
break;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59565';
$wp_version = '6.8-alpha-59566';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.