首页 WordPress函数大全 get_page_hierarchy()

get_page_hierarchy()

2020-05-01 / 4699阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_page_hierarchy( WP_Post[] $pages, int $page_id )

Order the pages with children under parents in a flat list.

描述

It uses auxiliary structure to hold parent-children relationships and runs in O(N) complexity

参数

$pages

(WP_Post[])
(Required)
Posts array (passed by reference).

$page_id

(int)
(Optional)
Parent page ID. Default 0.

返回

(string[]) Array of post names keyed by ID and arranged by hierarchy. Children immediately follow their parents.

大家谈论
    我的见解