Post Type Switcher

外掛說明

這個外掛在內容編輯器頁面中增加的簡單易用的內容類型下拉式選單,讓具備編輯內容權限的使用者能將現有內容類型重新指派為新的內容類型,它同時也能讓具備編輯內容權限的使用者在編輯內容時直接轉換內容類型。

支援的內容類型

這個外掛可以進行文章、頁面及自訂內容類型間的各種轉換組合:

  • 將頁面轉換為文章
  • 將文章轉換為頁面
  • 將文章轉換為某個自訂內容類型
  • 將某個自訂內容類型轉換為另一種自訂內容類型

這個外掛在 3.0.0 版之後,移除了對 [附件] 內容類型的支援。或許會在後續版本重新加入這項功能。

隱藏的內容類型如內容修訂、選單等均已刻意排除,如需存取這些隱藏的內容類型,可以使用 pts_post_type_filter 篩選器調整存取限制。

批次編輯

感謝 Matthew Gerring 對批次編輯提供的技術支援,使用者現在可以選取指定內容類型的全部文章,並將他們批次轉換為新的內容類型。

區塊編輯器

感謝 Daniel Bachhuber 對區塊編輯器/Gutenberg 外掛提供的技術支援,使用者現在無論使用區塊編輯器或傳統編輯器,均可自由轉換內容類型而不會損失任何嵌入的內容。

螢幕擷圖

  • [文章] 頁面中的 [內容類型] 欄位
  • [快速編輯] 中的 [內容類型] 介面
  • 編輯文章畫面中的 [內容類型] 介面

安裝方式

安裝方式

  1. 在 WordPress 控制台中,前往 [外掛]→[安裝外掛]。
  2. 搜尋「Post Type Switcher」。
  3. 點擊 [安裝] 按鈕便能安裝這個外掛。
  4. 點擊 [啟用] 按鈕便能啟用這個外掛。
  5. 在編輯內容的畫面中,[發佈] 按鈕的上方會出現 [內容類型] 介面。
  6. 將內容類型變更為符合需求的內容類型。

最低安裝需求

  • WordPress 5.0 或更新版本。
  • PHP 7.0.0 或更新版本。
  • MySQL 5.7 或更新版本。

建議安裝需求

  • WordPress 最新版本。
  • PHP 8.0 或更新版本。
  • MySQL 8.0 或更新版本或 MariaDB 10.5 或更新版本。

常見問題集

這個外掛的使用情境為何?

具備編輯內容權限的使用者需要將從其中一種內容類型變更為另一種時。

這個外掛會破壞原始內容關聯的分類法嗎?

應該不會。這個外掛僅會變更內容的 post_type 屬性。

這個外掛的操作會破壞由區塊編輯器製作的內容嗎?

應該不會。在切換編輯器類型時,編輯 HTML 要小心。

這個外掛會刪除網站內容嗎?

不會。這個外掛不含任何能刪除網站內容的程式碼。

外掛間產生衝突並非不可能發生,疑難排解也較為困難。

如果擔心內容發生意外,請在使用這個工具前先備份網站資料庫,並停用其他外掛。

如果仍有疑慮,請前往 WordPress.org 技術支援論壇尋求協助。

使用者評論

2024 年 2 月 7 日
Outstanding clean, simple and awesome plugin. Saved me maaany hours tonight! Big thanks!!
2024 年 1 月 31 日
Great and simple, even if you only change a few posts, you save a tangible amount of time. Thanks!
2024 年 1 月 22 日
Thank you SO MUCH for this plugin! I don't know why WordPress removed this feature. We had an older site where some pages were made as posts. Your plugin worked perfectly, and enabled us to convert those pages to posts. Thank you again!!
2023 年 10 月 26 日
Thank you, very good plugin, I changed 50 articles into pages in 2 minutes!
閱讀全部 234 則使用者評論

參與者及開發者

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

參與者

〈Post Type Switcher〉外掛目前已有 30 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Post Type Switcher〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

3.3.0

  • Hide the “Type” column by default

3.2.1

  • Update author
  • Add sponsor link

3.2.0

  • Block editor support

3.1.0

  • Fix post targeting when called recursively

3.0.0

  • Improved Quick-Edit and Bulk-Edit support
  • Remove attachment type support for now, as there is no way to switch back
  • Fix bug causing some post-types to switch unexpectedly

2.0.1

  • Ensure quick-edit works with new procedure
  • Quick-edit “Type” column works again!

2.0.0

  • Improved plugin compatibility with WooThemes Sensei
  • Filter post arguments vs. hook to save_post
  • Add “post_type_switcher” action

1.7.0

  • Add support for network activation

1.6.0

  • Add textdomains for localization
  • Load translation strings using load_plugin_textdomain()
  • Before saving data chack if it’s not an autosave using wp_is_post_autosave()
  • Before saving data chack if it’s not a revision using wp_is_post_revision()
  • Security: Prevent direct access to directories
  • Security: Translation strings escaping
  • Add screenshots

1.5.0 – norcross

  • Fix multiple quickedit dropdowns

1.4.0

  • Improve handling of non-public post types

1.3.0

  • Fix saving of autodrafts

1.2.1

  • Improved WordPress 3.9 integration (added dashicon to publish metabox)

1.2.0

  • Add bulk editing to supported post types
  • Props Matthew Gerring for bulk edit contribution

1.1.1

  • Add is_admin() check to prevent theme-side interference
  • Change save_post priority to 999 to avoid plugin compatibility issues
  • Remove ending closing php tag
  • HTML and PHPDoc improvements

1.1.0

  • Fix revisions being nooped
  • Fix malformed HTML for some user roles
  • Make a singleton (meh…)

1.0.0

  • Fix JS bugs
  • Audit post save bail conditions
  • Tweak UI for WordPress 3.3

0.3.0

  • Use the API to change the post type, fixing a conflict with persistent object caches
  • No longer requires JavaScript

0.2.0

  • Disallow post types that are not public and do not have a visible UI

0.1.0

  • Release