[wp-trac] [WordPress Trac] #33124: Unpublished posts in menu customizer
WordPress Trac
noreply at wordpress.org
Sat Jul 25 18:24:10 UTC 2015
#33124: Unpublished posts in menu customizer
--------------------------+-----------------------------
Reporter: greenshady | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I have a post type that utilizes various statuses other than the `publish`
post status, so it would naturally show "No items" for adding to the menu
without that status. Normally, you'd filter `nav_menu_meta_box_object` to
get the correct posts to appear on the menu management admin screen.
However, filters on this don't seem to work when managing menus in the
customizer.
Here's what I've been using:
{{{
add_filter( 'nav_menu_meta_box_object', 'my_nav_menu_meta_box_object' );
function my_nav_menu_meta_box_object( $object ) {
if ( isset( $object->name ) && 'post_type_name' === $object->name
) {
$statuses = array( 'open', 'close', 'private', 'hidden' );
$object->_default_query = wp_parse_args( array(
'post_status' => $statuses ), $object->_default_query );
}
return $object;
}
}}}
As far as I can tell, there are no new hooks directly related to menus in
the customizer for this.
Marking this under the "Customize" component. Might need to be the
"Menus" component. Not sure.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33124>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list