Core Function
View Source on Trac ↗ wp_find_hierarchy_loop()
wp_find_hierarchy_loop(
mixed $callback,
mixed $start,
mixed $start_parent,
mixed $callback_args = array()
) Finds hierarchy loops using a callback function that maps object IDs to parent IDs.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $callback callable | _args ) and outputs parent_ID. Required |
| $start int | The ID to start the loop check at. Required |
| int | $start_parent The parent_ID of $start to use instead of calling $callback( $start ). Use null to always use $callback. Required |
| $callback_args array | Optional. Additional arguments to send to $callback. Default empty array. |
Return Value
(array)
IDs of all members of loop.
Function Information
Since Version
3.1.0
Source File
wp-includes/functions.php
Advertisement