WordPress at a glance
function is not described

wp_find_hierarchy_loop() WP 3.1.0

Find hierarchy loops using a callback function that maps object IDs to parent IDs.

No Hooks.

Return

Array. IDs of all members of loop.

Usage

wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args );
$callback(callable) (required)
Function that accepts ( ID, $callback_args ) and outputs parent_ID.
$start(int) (required)
The ID to start the loop check at.
$start_parent(int) (required)
The parent_ID of $start to use instead of calling $callback( $start ). Use null to always use $callback
$callback_args(array)
Additional arguments to send to $callback.
Default: array()

Code of wp find hierarchy loop: wp-includes/functions.php VER 5.0.3

<?php
function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) {
	$override = is_null( $start_parent ) ? array() : array( $start => $start_parent );

	if ( !$arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) )
		return array();

	return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true );
}