我有一个从子页面数组创建自定义管理菜单项的函数。
他们好像回来了alpha-numeric
顺序
我想让他们按照page order
产生page attributes
.
我在网上搜索过,但似乎找不到一个简单的解决方案。在编写手动执行此操作的脚本之前,我想看看是否有人对wp_core
方法,使其更容易。
以下是当前代码供参考:
public function create_custom_menu() {
$menuArray = $this->get_top_level_pages();
foreach ($menuArray as $key => $value) {
add_menu_page(
$value->post_title,
$value->post_title,
\'manage_options\',
$value->post_name.\'-admin-page\',
array( $this, \'create_admin_page\'),
\'dashicons-admin-home\' ,
6
);
}
}