Title: Custom Post Type Auto Menu
Author: Ken Dirschl
Published: <strong>2013 年 9 月 7 日</strong>
Last modified: 2021 年 6 月 21 日

---

搜尋外掛

![](https://ps.w.org/custom-post-type-auto-menu/assets/banner-772x250.jpg?rev=768333)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/custom-post-type-auto-menu_bcc4c7.svg)

# Custom Post Type Auto Menu

 由 [Ken Dirschl](https://profiles.wordpress.org/badfun/) 開發

[下載](https://downloads.wordpress.org/plugin/custom-post-type-auto-menu.1.3.1.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/custom-post-type-auto-menu/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/custom-post-type-auto-menu/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/custom-post-type-auto-menu/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/custom-post-type-auto-menu/#developers)

 [技術支援](https://wordpress.org/support/plugin/custom-post-type-auto-menu/)

## 外掛說明

Custom Post Type Auto Menu allows the user to choose a custom post type, a menu,
and a menu parent item to which new custom post type posts
 will be added automatically.
This simplifies the menu process for users who may not be comfortable adding items
to menus, or for sites that have a large number of custom post type additions, such
as products.

The plugin supports multiple custom post types.

### Requirements

 * The custom post type you wish to use must be have both ‘public’ and ‘show_in_nav_menus’
   set to true.
 * Your theme must have menus.

### Known Issues

 * Ampersands and other HTML entites in titles can sometimes have curious results,
   such as multiple menu items.
 * After a custom post type post has been published, if it is downgraded to ‘draft’
   the item stays in the menu.
 * Bulk trashing custom post types will leave the menu items behind. Trash custom
   post types one at a time and it works fine.
 * Menu items can not have the same name, even if attached to different menus.
 * Known to conflict with Anything Order plugin: https://wordpress.org/plugins/anything-
   order/

### Acknowledgements

 * Thanks to all who have made suggestions for features to this plugin. I will try
   to put aside some time to work on it.
 * Many thanks to [codbox](https://github.com/codbox) for the bug fixes and the 
   new class. Much appreciated!
 * Thanks to Andrew Kurtis of [WebHostingHub](http://www.webhostinghub.com/) for
   the Spanish translation
 * There are various urls in the code from developers whose solutions I used to 
   solve problems. Thanks everyone!

## 螢幕擷圖

[⌊Custom Post Type Settings page. Choose at least one.⌉⌊Custom Post Type Settings
page. Choose at least one.⌉[

Custom Post Type Settings page. Choose at least one.

[⌊Menu Settings page. Choose which menu and which menu item the automated cpt post
should appear in.⌉⌊Menu Settings page. Choose which menu and which menu item the
automated cpt post should appear in.⌉[

Menu Settings page. Choose which menu and which menu item the automated cpt post
should appear in.

## 安裝方式

 1. Upload the plugin to your site and activate.
 2. CPT Auto Menus page is now in main admin menu under Settings.
 3. Use checkbox to select which Custom Post Types you want an automated menu for, 
    then Save Changes.
 4. You will be redirected to Menu Settings tab. Select which menu and which parent
    menu item where you wish the CPT to display.

## 常見問題集

### How many custom post types can I use?

The plugin now supports multiple custom post types. Use as many as you like.

### Can I create sub-sub menu items?

Currently the plugin works for top-level menu items only.

### What about categories and pages?

There are other available solutions for that, but if there is demand I could incorporate
it in future releases.

### Can I add existing custom post type posts to the menu?

Some users have many existing cpt’s and want to change them to a new menu. This 
can be done by selecting all your custom post types
 and setting them to ‘draft’
status, then back to ‘publish’. The plugin will detect them as new, and they will
be added.

### Why do post types have to be public?

Custom post types must be set to public for the plugin to see them. This is because
one of the assumptions of not setting a post type
 to public is that ‘show_in_nav_menus’
will be false. Obviously this is not the desired outcome of a plugin that automatically
adds items to a menu.

## 使用者評論

![](https://secure.gravatar.com/avatar/592c5c958a148e54a00dfbe2e1d553653e646ac9f8ceb0bc14fd65a60993b544?
s=60&d=retro&r=g)

### 󠀁[Does not work](https://wordpress.org/support/topic/does-not-work-1599/)󠁿

 [humantheory](https://profiles.wordpress.org/humantheory/) 2024 年 7 月 1 日

Tested with Toolset custom post type.

![](https://secure.gravatar.com/avatar/6cef5d45acf525ca0640f8e51cbf63d3259f4c72b66ddaffe89728265ca6c230?
s=60&d=retro&r=g)

### 󠀁[still works perfectly fine](https://wordpress.org/support/topic/still-works-perfectly-fine/)󠁿

 [somagfx](https://profiles.wordpress.org/somagfx/) 2022 年 4 月 7 日 1 則留言

I just tested this plugin because of so many bad reviews. Still after years, this
little helper just does its job as it intended to be. Amazing. I love those great
tools. Thank you!

![](https://secure.gravatar.com/avatar/0c62ecc7c4e2a56cbf0299850137d35b35d9f1ec8f43d47556033e1745253ae4?
s=60&d=retro&r=g)

### 󠀁[Does not work](https://wordpress.org/support/topic/does-not-work-1191/)󠁿

 [Hani Guda](https://profiles.wordpress.org/gudahani/) 2020 年 4 月 19 日 1 則留言

Does not auto add new menu items nor change the parent item

![](https://secure.gravatar.com/avatar/a2821a3bac462c3a64d6223cdab66bdb3244928437ad33d1380d0e413ed3e7ec?
s=60&d=retro&r=g)

### 󠀁[Works perfectly](https://wordpress.org/support/topic/works-perfectly-1896/)󠁿

 [degroeifabriek](https://profiles.wordpress.org/degroeifabriek/) 2020 年 4 月 3
日 1 則留言

Easy to set up, does exactly what it should do.

![](https://secure.gravatar.com/avatar/d7724d94ac0bffee8f882ef76f2972974d40bf8b153447715303310cdf92fd98?
s=60&d=retro&r=g)

### 󠀁[Could be good if an option would been added](https://wordpress.org/support/topic/could-be-good-if-an-option-would-been-added/)󠁿

 [whappe](https://profiles.wordpress.org/whappe/) 2019 年 7 月 18 日 3 則留言

There is no option to insert new menu items at the top (inverse sorting). Therefore
not usable for my purpose.

![](https://secure.gravatar.com/avatar/929a786af400d02c347a3e0eafa15cfe6ec124a249f685f5fabb807a82eadd14?
s=60&d=retro&r=g)

### 󠀁[Very useful but lacks taxonomy filtering](https://wordpress.org/support/topic/very-useful-but-lacks-taxonomy-filtering/)󠁿

 [smatzis](https://profiles.wordpress.org/smatzis/) 2019 年 4 月 11 日

Congratulations for your good work!!!

 [ 閱讀全部 17 則使用者評論 ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Custom Post Type Auto Menu〉的開發相關工作。

參與者

 *   [ Ken Dirschl ](https://profiles.wordpress.org/badfun/)

[將〈Custom Post Type Auto Menu〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/custom-post-type-auto-menu)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/custom-post-type-auto-menu/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/custom-post-type-auto-menu/)，
或透過 [RSS](https://plugins.trac.wordpress.org/log/custom-post-type-auto-menu/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/custom-post-type-auto-menu/)。

## 變更記錄

#### 1.3.1

 * tested up to WP 5.7

#### 1.3.0

 * tested up to WP 5.4
 * refactored the codebase and reorganized the directories
 * fixed get_terms to new requirement according to the Codex

#### 1.2.2

 * tested with WP 5.0

#### 1.2.1

 * tested with WP 4.9 on multisite

#### 1.2.0

 * test for public post types and give warning if not set. Removed deprecated screen
   icon function.

#### 1.1.9

 * very minor version changes and a new deploy test

#### 1.1.8

 * A few small bug tweaks

#### 1.1.7

 * SVN did not upload the new classes directory. Going to re-do the whole commit

#### 1.1.6

 * some kind of SVN error. Attempted fix.

#### 1.1.5

 * Fixed bulk trash error
 * Fixed publish to draft error
 * Broke up main function into new class

#### 1.1.4

 * Fixed current screen error that gave a php warning
 * Fixed editing error where titles with an ampersand would create multiple menu
   items

#### 1.1.3

 * Fixed bug that sometimes prevented page redirects and caused ‘headers already
   sent’ error
 * Improved error message for empty custom post type list
 * Fixed intermittent ajax bug
 * Added proper sanitization to callbacks

#### 1.1.2

 * Fixed translation strings to WordPress I18n standards
 * Formatted code to WordPress standards
 * Added a few missing empty variable checks
 * Added missing exits after redirect functions

#### 1.1.1

 * Added German translation. Thanks Dad!
 * Updated Spanish translation. Thanks Andrew!

#### 1.1.0

 * Now able to select multiple custom post types
 * Moved CPT Auto Menu to its own menu page
 * Added Spanish, French and Italian translations

#### 1.0.1

 * Fixed bug where saving draft created menu item

#### 1.0.0

 * First upload of working plugin.

## 中繼資料

 *  版本 **1.3.1**
 *  最後更新 **5 年前**
 *  啟用安裝數 **500+**
 *  WordPress 版本需求 ** 3.0.1 或更新版本 **
 *  已測試相容的 WordPress 版本 **5.7.19**
 *  語言
 * [English (US)](https://wordpress.org/plugins/custom-post-type-auto-menu/)
 * 標籤:
 * [custom post type](https://tw.wordpress.org/plugins/tags/custom-post-type/)[menus](https://tw.wordpress.org/plugins/tags/menus/)
 *  [進階檢視](https://tw.wordpress.org/plugins/custom-post-type-auto-menu/advanced/)

## 評分

 3.6 星，滿分為 5 星

 *  [  10 個 5 星使用者評論     ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/?filter=4)
 *  [  1 個 3 星使用者評論     ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/?filter=2)
 *  [  5 個 1 星使用者評論     ](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/custom-post-type-auto-menu/reviews/)

## 參與者

 *   [ Ken Dirschl ](https://profiles.wordpress.org/badfun/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/custom-post-type-auto-menu/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYCUSEFX8Q89C)