前言介紹
- 這款 WordPress 外掛「WP Customizer」是 2013-06-04 上架。
- 目前有 30 個安裝啟用數。
- 上一次更新是 2017-11-09,距離現在已有 2732 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.8 以上版本才可以安裝。
- 有 2 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
vicchi |
外掛標籤
scripts | customise | customize | functions | wp-customizer |
內容簡介
這個外掛讓你能夠在 WordPress 網站中管理和載入特定的功能、腳本和 CSS 檔案,而不需要編輯你的佈景主題的 functions.php 或其他原始檔案。
設定和選項包括:
選擇你想要載入的客製化類型;包括功能、腳本和 CSS 檔案的任意組合。
選擇你想要載入客製化的位置;在 WordPress 前端、在 WordPress 管理介面或兩者皆載入。
選擇你想要存儲客製化檔案的位置,無需新增或修改你的佈景主題或外掛的原始檔案。
過濾器支援及使用方式
WP Customizer 支援多個過濾器;此外掛的過濾器允許你
修改即將載入的功能檔案集合
修改即將載入的腳本檔案集合
修改即將載入的每個腳本檔案的特性,並傳送作為參數傳至 wp_enqueue_script
修改即將載入的 CSS 檔案集合
修改即將載入的每個 CSS 檔案的特性,並傳送作為參數傳至 wp_enqueue_style
每個過濾器只會在此外掛的選項中啟用客製化類型時呼叫;如果啟用客製化類型但找不到要載入的檔案,該過濾器仍會被呼叫,但會傳送一個空參數。
和所有 WordPress 過濾器一樣,任何過濾器勾子函數應該返回修改後的參數,或是如果沒有進行修改,則返回原本的參數。
wp_customizer_functions、wp_customizer_admin_functions、wp_customizer_common_functions
當準備載入前端功能清單 (wp_customizer_functions)、管理介面功能清單 (wp_customizer_admin_functions) 或共同功能清單 (wp_customizer_common_functions) 時,將呼叫功能過濾器。所有過濾器處理函式接收到的引數都是相同的。過濾函式會接收一個陣列的檔案名稱作為單一引數。
範例: 藉由返回空的檔案清單,防止載入所有功能檔案。
add_filter('wp_customizer_functions', 'function_handler', 10, 1);
function function_handler($files) {
// $files = array(
// array(
// 'file' => (功能檔案的絕對路徑)
// ),
// array(...)
// );
return array();
}
wp_customizer_scripts、wp_customizer_admin_scripts、wp_customizer_common_scripts
當準備載入前端腳本清單 (wp_customizer_scripts)、管理介面腳本清單 (wp_customizer_admin_scripts) 或共同腳本清單 (wp_customizer_common_scripts) 時,將呼叫腳本過濾器。所有過濾器處理函式接收到的引數都是相同的。過濾函式會接收一個陣列的檔案詳細資料作為單一引數。
範例: 將 jQuery 加入所有腳本的相依性,並啟用每個腳本在文章底部載入。
add_filter('wp_customizer_scripts', 'script_handler', 10, 1);
function script_handler($files) {
// $files = array(
// array(
// 'file' => (腳本檔案的絕對路徑),
// 'handle' => (自動產生的腳本 handle),
原文外掛簡介
This plugin allows you to manage and load site specific functions, scripts and CSS files into your WordPress site without the need to edit your theme’s functions.php or any other source file.
Settings and options include:
Choose the type of customization you want to load; functions, scripts, CSS in any combination.
Choose where you want the customizations to load; in the WordPress front-end, in the WordPress admin screens or both.
Choose where you want to store your customization files, without the need to add to or modify your theme’s or your plugin’s source files.
Filter Support And Usage
WP Customizer supports multiple filters; the plugin’s filters allow you to
modify the set of functions files that are about to be loaded
modify the set of script files that are about to be loaded
modify the characteristics of each script file that is about to be loaded and which will be passed as arguments to wp_enqueue_script
modify the set of CSS files that are about to be loaded
modify the characteristics of each CSS file that is about to be loaded and which will be passed as arguments to wp_enqueue_style
Each filter will be only be called if the customization type is enabled in the plugin’s options; if a customization type is enabled but no files are found to be loaded, the filter will still be called but will be passed an empty argument.
As with all WordPress filters, any filter hook function should either return the modified argument or the original argument if no modification were made.
wp_customizer_functions, wp_customizer_admin_functions, wp_customizer_common_functions
The functions filters are called when preparing to load the list of front-end functions (wp_customizer_functions), of admin functions (wp_customizer_admin_functions) and of common functions (wp_customizer_common_functions). The arguments that each filter hook function receives is identical in all cases. The filter hook function takes a single argument which is an array of file names.
Example: Prevent all function files from loading by returning an empty file list.
add_filter('wp_customizer_functions', 'function_handler', 10, 1);
function function_handler($files) {
// $files = array(
// array(
// 'file' => (absolute path of function file)
// ),
// array(...)
// );
return array();
}
wp_customizer_scripts, wp_customizer_admin_scripts, wp_customizer_common_scripts
The scripts filters are called when preparing to load the list of front-end scripts (wp_customizer_scripts), of admin scripts (wp_customizer_admin_scripts) and of common scripts (wp_customizer_common_scripts). The arguments that each filter hook function receives is identical in all cases. The filter hook function takes a single argument which is an array of file details.
Example: Add jQuery as a dependency to all scripts and enable each script to load in the post’s footer.
add_filter('wp_customizer_scripts', 'script_handler', 10, 1);
function script_handler($files) {
// $files = array(
// array(
// 'file' => (absolute path of script file),
// 'handle' => (auto-generated handle for script),
// 'src' => (URL of script file),
// 'deps' => (dependencies, defaults to an empty array),
// 'ver' => (version, defaults to false),
// 'in_footer' => (load in footer, defaults to false),
// ),
// array(...)
// );
foreach ($files as $file) {
$file['deps'] = array('jquery');
$file['in_footer'] = true;
}
return $files;
}
wp_customizer_css, wp_customizer_admin_css, wp_customizer_common_css
The CSS filters are called when preparing to load the list of front-end CSS (wp_customizer_css), of admin CSS (wp_customizer_admin_css) and of common CSS (wp_customizer_common_css). The arguments that each filter hook function receives is identical in all cases. The filter hook function takes a single argument which is an array of file details.
Example: Override the media type for all CSS files to use the screen media type.
add_filter('wp_customizer_css', 'css_handler', 10, 1);
function css_handler($files) {
// $files = array(
// array(
// 'file' => (absolute path of css file),
// 'handle' => (auto-generated handle for CSS),
// 'src' => (URL of CSS file),
// 'deps' => (dependencies, defaults to an empty array),
// 'ver' => (version, defaults to false),
// 'media' => (media type, defaults to 'all')
// ),
// array(...)
// );
foreach ($files as $file) {
$file['media'] = 'screen';
}
return $files;
}
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Customizer」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.0 | 1.0.1 | 1.0.2 | trunk |
延伸相關外掛(你可能也想知道)
Erident Custom Login and Dashboard 》注意:Erident自訂登入與儀表板現已更名為Ultimate Dashboard。請安裝Ultimate Dashboard。, 如果您是Erident外掛的現有使用者,您可以透過WordPress管理儀表...。
MS Custom Login 》這個外掛可以讓您在 MS Custom Login 設定頁面上上傳圖片和選擇顏色,以自訂化登入頁面。它使用 WordPress 的媒體上傳工具和顏色選擇器。, 功能, , 更改公司...。
WooCommerce Send Emails 》WooCommerce Send Emails 是一款外掛,可以重新發送由 WooCommerce 自動發送的交易電子郵件,這些電子郵件是在創建訂單時(客戶結帳時)自動發送的。您可以發...。
My Favicon 》「BleuT My FavIcon」外掛能讓你輕鬆地自訂網站的網站圖示,只需要上傳一個圖片檔案即可。。
Debrandify · Remove or Replace WordPress Branding 》Debrandify(前身為DeWordPressify)是一個工具套件外掛,提供了許多設置來自定義和改進WordPress。您可以刪除WordPress的品牌標識,並將其替換為您自己的品...。
Photosynth Embed Shortcode 》此為一款小工具,可讓您輕鬆快速地使用簡單的簡碼([synth])在文章和頁面中建立照片合成。使用簡碼的好處是在編輯文章/頁面時預覽時能有效避免問題。, 請注...。