Wordpress plugins
WP Customizer

WP Customizer

Version : 1.0.1
Tested up to : 3.6.1
Number of download : 2395
Author : Gary Gale
Average rating : 5 / 5 on 2 votes 2 votes, 5 avg.rating

Screenshots

WP Customizer
WP Customizer
WP Customizer
WP Customizer

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; }

Download now