quick_edit_dropdown_pages_args
云策文档标注
概述
quick_edit_dropdown_pages_args 是一个 WordPress 过滤器,用于修改快速编辑界面中页面父级下拉菜单的生成参数。它允许开发者自定义 wp_dropdown_pages() 函数的参数,以控制页面列表的显示方式。
关键要点
- 过滤器名称:quick_edit_dropdown_pages_args
- 用途:过滤快速编辑页面父级下拉菜单的参数,传递给 wp_dropdown_pages()
- 参数:$dropdown_args(数组,传递给 wp_dropdown_pages() 的参数)和 $bulk(布尔值,表示是否为批量操作)
- 相关函数:wp_dropdown_pages(),用于生成页面下拉菜单
- 版本历史:从 WordPress 2.7.0 引入,5.6.0 添加了 $bulk 参数
代码示例
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk );注意事项
- 参数 $dropdown_args 支持 wp_dropdown_pages() 的所有选项,如 child_of、sort_column、hierarchical 等。
- include 参数不能与 child_of、parent、exclude、meta_key、meta_value 或 hierarchical 同时使用。
- offset 参数需要与 number 参数一起使用。
原文内容
Filters the arguments used to generate the Quick Edit page-parent drop-down.
Description
See also
Parameters
$dropdown_argsarray-
An array of arguments passed to wp_dropdown_pages() .
More Arguments from wp_dropdown_pages( … $args )
Array or string of arguments to retrieve pages.
child_ofintPage ID to return child and grandchild pages of. Note: The value of$hierarchicalhas no bearing on whether$child_ofreturns hierarchical results. Default 0, or no restriction.sort_orderstringHow to sort retrieved pages. Accepts'ASC','DESC'. Default'ASC'.sort_columnstringWhat columns to sort pages by, comma-separated. Accepts'post_author','post_date','post_title','post_name','post_modified','menu_order','post_modified_gmt','post_parent','ID','rand','comment*count'.
'post*'can be omitted for any values that start with it.
Default'post_title'.hierarchicalboolWhether to return pages hierarchically. If false in conjunction with$child_ofalso being false, both arguments will be disregarded.
Default true.excludeint[]Array of page IDs to exclude.includeint[]Array of page IDs to include. Cannot be used with$child_of,$parent,$exclude,$meta_key,$meta_value, or$hierarchical.meta_keystringOnly include pages with this meta key.meta_valuestringOnly include pages with this meta value. Requires$meta_key.authorsstringA comma-separated list of author IDs.parentintPage ID to return direct children of. Default -1, or no restriction.exclude_treestring|int[]Comma-separated string or array of page IDs to exclude.numberintThe number of pages to return. Default 0, or all pages.offsetintThe number of pages to skip before returning. Requires$number.
Default 0.post_typestringThe post type to query. Default'page'.post_statusstring|arrayA comma-separated list or array of post statuses to include.
Default'publish'.
$bulkbool-
A flag to denote if it’s a bulk action.
Source
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args, $bulk );