
內容簡介
這是一個功能外掛,旨在實現票號 #34923:在定制器中引入基本的內容創作。
這個插件的目標是在 Customizer 中公開文章和頁面的編輯,允許您編輯任意數量的帖子和帖子元數據,預覽更改並在保存之前將其實時查看。此插件是由 Widget Customizer 功能作為插件項目誕生的,該項目已合併到 WordPress 核心:自從小工具(在 3.9 中)和導航菜單(4.3)可以在 Customizer 中管理後,帖子和頁面也應該在 Customizer 中進行編輯。
你知道嗎,修改特色圖片實際上會使更改立即生效,甚至在將帖子保存之前?這是非常令人驚訝 / 意料之外的行為。要真正預覽特色圖片的更改,唯一的方法是使用 Customize Posts 等工具。
同樣地,你知道嗎,如果您從帖子編輯器中更改頁面模板,它無法在預覽頁面中預覽?當您更改選定的頁面模板時,當您預覽該頁面時,更改將不會顯示(參見票號 #11049)。但是,在 Customize Posts 中,您可以通過更改下拉選擇然後預覽刷新後看到您的頁面如何顯示新模板。
大多數包含保存為自定義字段(postmeta)的數據的 metabox 上的其他更改也在單擊預覽按鈕時進行編寫。Customize Posts 插件提供了一個框架,在 Customizer 中編輯帖子元數據,並實時預覽更改。(在處理預覽時不正確地持續 postmeta 的潛在問題已被記錄在票號 #20299 中。)
盡可能使用 WordPress 4.5 中引入的選擇性刷新功能,以預覽 Customize Posts 中的更改。這不僅意味著預覽帖子和 postmeta 的更改速度更快,而且還允許您在預覽時單擊元素以聚焦 Customizer 面板中的相應控制。例如,您可以在預覽中以 shift-click 單擊帖子標題以聚焦帖子標題控制的輸入字段,或者在特色圖片上 shift-click 以聚焦控制的按鈕以打開媒體庫。
此插件的開發在 GitHub 上完成。歡迎進行拉取請求。在轉到插件論壇之前,請參閱報告的問題(issues)。
(這個 Customized Posts 插件不要與 10up 的 Post Customizer 混淆。)
Demo Videos
以下按反向時間順序列出。第一個、最近的視頻顯示了更多的光澤。
[2016-04-28] 0.5.0 中的新功能。
[2016-03-28] 從帖子編輯屏幕預覽帖子。
[2016-03-05] 在 Customizer 中開啟草稿帖子以預覽標題包裝。
[2016-03-04] 演示 WP 可視化豐富文本編輯器(TinyMCE),包括從媒體庫中插入圖像。帖子內容可以在 Customizer 中進行編輯,在多個上下文中進行預覽。例如,這使您可以預覽“閱讀更多”標記在帖子列表頁面上出現時的外觀,並且您可以導航到單個帖子以繼續預覽後續段落。您可以擴展這個 e
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
This is a feature plugin intended to implement #34923: Introduce basic content authorship in the Customizer.
The goal for this plugin is to be able to expose the editing of posts and pages in the Customizer, allowing you to edit post data and postmeta for any number of posts, and preview the changes before saving them for others to see. This plugin was birthed out of the Widget Customizer feature-as-plugin project which was merged into WordPress Core: as widgets (in 3.9) and nav menus (4.3) can now be managed in the Customizer, so too should posts and pages be editable in the Customizer as well.
Did you know that changing the featured image actually makes the change live even before you save the post? This is very surprising/unexpected behavior. The only way to truly preview a change to a featured image is to use something like Customize Posts.
Likewise, did you know that changing a page template cannot be previewed from the post editor? When you change the selected page template, the change will not show up when you preview the page (see #11049). However, in Customize Posts you can preview changes to the page template just by changing the dropdown selection, and then you can see what your page would look like with the new template after the preview refreshes.
Most other changes to metaboxes containing data that gets saved to custom fields (postmeta) also get written when clicking the Preview button. The Customize Posts plugin provides a framework to edit postmeta in the Customizer with a live preview of the changes. (Fixing this underlying issue of incorrectly persisting postmeta when doing a preview is captured in #20299.)
As much as possible, the previewing of changes in Customize Posts utilizes the selective refresh capabilities introduced in WordPress 4.5. Not only does this mean it is faster to preview changes to posts and postmeta, but it also allows you to shift-click on an element to focus on the corresponding control in the Customizer pane. For example you can shift-click on the post title in the preview to focus on the post title control’s input field, or shift-click on a featured image to focus on the control’s button to open the media library.
Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum.
(This Customize Posts plugin is not to be confused with 10up’s Post Customizer.)
Demo Videos
The following are listed in reverse chronological order. The first, more recent videos, show more polish.
[2016-04-28] New features in 0.5.0.
[2016-03-28] Previewing post from Post Edit screen.
[2016-03-05] Opening a draft post in the Customizer to preview title wrapping.
[2016-03-04] Demo featuring the WP visual rich text editor (TinyMCE), including the insertion of images from the media library. Post content can be edited in the Customizer and previewed in multiple contexts. For example, this allows you to preview how a Read More tag will appear when the post appears on a post list page, and you can navigate to the single post to continue previewing subsequent paragraphs. You can expand the editor into a full-screen mode to focus on writing and then quickly preview the changes on the site by toggling the editor. You can make changes to as many posts as you want, but none of the changes will go live until you hit Save & Publish: everything is previewed so there is no “save and surprise”.
[2016-03-03] Demonstration of integration with Customize Setting Validation (#34893) to gracefully handle failures to save due to post locking and concurrent user editing:
[2016-03-01] Demonstration of hooking into edit post links so that they actually work in the Customizer and expand the section to edit the given post (as opposed to the link doing nothing at all when clicked), as well as shift-clicking on the title and content (needs better discovery UI, see #27403):
