| 开发者 | alian |
|---|---|
| 更新时间 | 2026年11月18日 19:47 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
astro-hide-unpublished-post-types-from-menu folder to the /wp-content/plugins/ directory.Yes, with the astro_hupt_is_item_hidden filter. It receives true when the item points to unpublished content, and the menu item. For example, to keep private pages in the menu for logged-in users:
add_filter( 'astro_hupt_is_item_hidden', function ( $hidden, $item ) { return $hidden && ! ( is_user_logged_in() && 'private' === get_post_status( $item->object_id ) ); }, 10, 2 );
Not anymore. Up to version 1.0.4 it hid unpublished content from the admin lists for users other than administrators, which did not hide anything from the menus and prevented authors and editors from seeing their drafts and the posts awaiting review. Version 2.0.0 removed that behavior.