Open m-e-h opened 7 years ago
I'm not sure I understand what the issue is. You seem to be talking about the default arguments and the post_parent
field?
Are you asking to show a hierarchical drop-down?
If so, this specific control is not meant to be a replacement for the WP parent drop-down. That should really be used when possible. This is meant to be a drop-down of a flat post type. I could see renaming it to parent-flat
if necessary.
Thats correct, a hierarchical drop-down. My specific use case is a cpt which relies on the parent child hierarchy, which I could use the page attributes metabox, but I was thinking more for consistency and user expectation.
That would take a rewrite of the control to handle both hierarchical or non-hierarchical post types. Or, just a custom control for handling hierarchical post types. I'd lean toward the latter option for now and maybe revisit adding a hierarchical parent control in future version of ButterBean.
OK, I wasn't thinking it had to be one or the other. I understand now.
The default parent select includes other child posts among the options.
'post_parent' => 0
in butterbean only shows top-level posts.Not sure what the default is or if NULL could be used for the value. Core uses
wp_dropdown_pages
which defaults to pages and sub-pages ifdepth
isn't specified? https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/meta-boxes.php#L780-L798