
內容簡介
自訂面板匯出/匯入
自訂面板匯出/匯入外掛讓您能夠直接從自訂面板界面匯出或匯入您的 WordPress 自訂設定!如果您的佈景主題使用 WordPress 自訂面板進行設定,則此外掛適用於您!
請造訪我們的部落格瞭解更多有關自訂面板匯出/匯入外掛的資訊。
新增!匯出選項
自訂面板匯出/匯入外掛先前僅能匯出使用get_theme_mods 函式儲存的佈景主題修飾,但現在不再如此!自訂面板匯出/匯入外掛現在也會匯出使用選項儲存的設定!
運作方式
匯出自訂面板設定非常簡單。從自訂面板內點擊匯出按鈕,檔案將自動下載包含您設定的設定。匯出檔案命名為您的佈景主題名稱,並且只能用於匯入與它們關聯的佈景主題或子佈景主題的設定。匯出檔案包含使用get_theme_mods 函式擷取的修飾或儲存為選項的自訂面板設定的序列化拋棄。
匯入自訂面板設定同樣簡單。選擇您要匯入的匯出檔案,選擇是否下載和匯入圖片(類似於匯入文章),最後點擊匯入按鈕。匯入您的設定後,頁面將重新載入,您的新設計將顯示。
匯出自訂選項
開發者可以通過使用 cei_export_option_keys 過濾器將非自訂面板選項匯出。通過在下面示例中添加您的選項鍵到要匯出的選項數組中,那些選項可以被匯出和匯入。
function my_export_option_keys( $keys ) {
$keys[] = 'my_option_key';
$keys[] = 'another_option_key';
return $keys;
}
add_filter( 'cei_export_option_keys', 'my_export_option_keys' );
已知問題
此外掛目前僅適用於活躍的佈景主題,對於正在使用主題測試驅動程式或新自訂面板主題預覽進行預覽的佈景主題,不適用。
貢獻!
我們很樂意聽取您對如何改進自訂面板匯出/匯入外掛的意見,或更好的是,看到佈景主題開發人員積極貢獻!如果您有興趣貢獻,請不要猶豫讓我們知道,我們很樂意讓其他人參與其中。
自訂面板匯出/匯入外掛是由 Beaver Builder 的精英團隊捐獻開發。
外掛標籤
開發者團隊
原文外掛簡介
Customizer Export/Import
The Customizer Export/Import plugin allows you to export or import your WordPress customizer settings from directly within the customizer interface! If your theme makes use of the WordPress customizer for its settings, this plugin is for you!
Please visit our blog for more info on the Customizer Export/Import plugin.
New! Export Options
The Customizer Export/Import plugin previously only exported options saved as theme mods using the get_theme_mods function, but that is no more! The Customizer Export/Import plugin now exports settings saved as options as well!
How It Works
Exporting customizer settings is easy. Click the export button from within the customizer and a file will automatically begin downloading with your settings. Export files are named after your theme and can only be used to import settings for the theme or child theme that they came from. Export files contain a serialized dump of mods retrieved using the get_theme_mods function or customizer settings saved as options.
Importing customizer settings is just as easy. Choose the export file you would like to import, select whether you would like to download and import images (similar to importing posts), and finally, click the import button. Once your settings have been imported the page will refresh and your new design will be displayed.
Exporting Custom Options
Developers can also have arbitrary options that aren’t part of the customizer exported by using the cei_export_option_keys filter. Those options can be exported and imported by adding your option key to the array of options that will be exported as shown below.
function my_export_option_keys( $keys ) {
$keys[] = 'my_option_key';
$keys[] = 'another_option_key';
return $keys;
}
add_filter( 'cei_export_option_keys', 'my_export_option_keys' );
Known Issues
This plugin currently only works for active themes, not themes that are being previewed with either the Theme Test Drive plugin or the new customizer theme preview.
Contribute!
We’d love to hear your feedback as to how we could improve the Customizer Export/Import plugin, or better yet, see theme developers actively contribute! Don’t hesitate to let us know if you’re interested in contributing as we would gladly have others on board.
The Customizer Export/Import plugin is brought to you by the fine folks at Beaver Builder.
