wp_find_hierarchy_loop
函数
      wp_find_hierarchy_loop ( $callback, $start, $start_parent, $callback_args = array() )    
  - Access
 - Private
 
- 参数
 - 
- 
                (callable)
$callback
Function that accepts ( ID, $callback_args ) and outputs parent_ID.- Required: 是
 
 - 
                (int)
$start
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: 是
 
 - 
                (array)
$callback_args
Optional. Additional arguments to send to $callback.- Required: 否
 - Default: array()
 
 
 - 
                (callable)
 
- 返回值
 - 
- (array) IDs of all members of loop.
 
 
- 定义位置
 - 
- 
                                  wp-includes/functions.php
, line 6799 
 - 
                                  wp-includes/functions.php
 
- 引入
 - 3.1.0
 
- 弃用
 - –
 
使用一个将对象ID映射到父级ID的回调函数来查找层次循环。
function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) {
	$override = is_null( $start_parent ) ? array() : array( $start => $start_parent );
	$arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args );
	if ( ! $arbitrary_loop_member ) {
		return array();
	}
	return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。