Hide Drafts in Menus

外掛說明

If you unpublish a page or post, it still appears in your custom menus. This plugin automatically prevents pages/posts set to “draft” or “pending review” from appearing in custom menus on the site, while keeping their place in the menu structure. When they’re published, they’ll appear in the menu automatically.

This plugin also modifies the custom menu editing screen to clearly indicate the unpublished status of items in the menu.

NOTE: We are aware of a limitation in the plugin, that a page/post must be published to appear in the list of items you can select to add to the menu. We are working on a solution. In the meantime, the workaround is to temporarily publish the page/post, add it to the menu, and then set it back to “draft”.

安裝方式

  1. Upload the plugin files to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. There’s no step 3!

使用者評論

2023 年 9 月 21 日
Does what it says, I could easily extend it to hide also private posts.
2020 年 12 月 29 日
This Plugin makes exactly what i'm looking for. But it's special, that this plugin is necessary, because that should be a part of the stock WP. and it's very easy, install, run, done!
2019 年 4 月 16 日
Thanks so much - i had a whole pile of prebuilt pages I added in my new theme which threw out my menu - installed this and - GONE - thanks so much
2019 年 3 月 30 日
It works prefectly without any configuration. Install it, activate it, done. Thanks to the developer. 🙂
2017 年 7 月 18 日
Had a project where the client wanted to be able to add and hide menu items and pages and this allowed them to do that easily by changing the pages to draft status. Far easier than allowing access to WP Nav Menus which most clients mess up!
2017 年 6 月 5 日
This plugin helped me with a project I was working on for a client. Thanks for the plugin!
閱讀全部 7 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Hide Drafts in Menus〉的開發相關工作。

參與者

將〈Hide Drafts in Menus〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.5.0 – 2023.11.01

  • Changed SQL query to simply look for all posts that are not set to a status of publish, rather than the previous check for a few specific status values.
  • Removed now-redundant post status text on menu editing screen (WordPress now displays the status rather than the post type for non-published menu items) and changed visual appearance to a light red background and partial opacity.

1.4.1 – 2023.07.23

  • Fixed bug that prevented draft page CSS from being applied for menus that are not assigned to a theme menu location.
  • Updated “tested up to” to 6.3.

1.4.0

  • Added global $r34hdm_results variable to eliminate duplicate queries, resulting in a slight performance increase.
  • Updated “tested up to” to 5.8.1.

1.3.1

  • Fixed bug that would return a PHP warning if the menu is empty. In some cases this may have been breaking the page preview in the Customizer.
  • Updated “tested up to” to 5.3.

1.3.0

  • Added rekey array of menu items after removing hidden items.
  • Added wp_nav_menu_objects action.

1.2.1

  • Added ‘future’ status to pages hidden in menus.

1.2.0.1

  • Fixed database error message that occurred when there were no unpublished items.

1.2.0

  • Added ‘trash’ status to pages hidden in menus.

1.1.0

  • Fixed issues that would trigger PHP notices on Appearance > Menus page.

1.0.0.2

  • Tested with WordPress 4.9.5.

1.0.0.1

  • Updated “Tested up to” to 4.7.
  • Added note about pages needing to be published temporarily to appear in the list of options.

1.0.0

Initial release in WordPress Plugin Directory.