WordPress Customizer

customizer-4.2-1024x516

 

簡介

Customizer 是 WordPress 提供的一個即時預覽的framework。它提供了一個簡單且一致的介面讓使用者可以針對主題或網站進行不同層面的客製化,包含了顏色,Layout,widget、menu等功能。主題和插件可以增加客制的設定到Customizer中。Customizer是一個標準的方法來增加設定項到你的主題。

Customizer 物件

Customizer API 是物件導向的。主要有四種類型的物件:Panels, Sections, Settings 和 Control。Settings 和 UI 元件 (Control) 關聯,儲存設定到資料庫。Sections是用來組織Controls的容器。Panels則是Secionts的容器,可以讓多個 Sections 群組起來。

每一個 Customizer物件都能用一個 PHP 類別來表示,所有的物件則夠過 WP_Customize_Manager 這個物件來管理。

customizer-object-types

To add, remove, or modify any Customizer object, and to access the Customizer Manager, use the customize_register hook:

要新增,移除或修改任何的Customizer物件,同時存取 Customizer Manager, 請使用 customize_register hook:

發佈留言