Novuso WP Common
Registers common libraries to allow plugins and themes to share a common dependency in WordPress., (*1)
Goal
Register CSS and JavaScript libraries that are not available in WordPress core., (*2)
Installation
If you use Composer to manage WordPress dependencies, simply add the following
line to your composer.json file:, (*3)
"novuso/novuso-wp-common": "~0.2"
And run composer update
and this plugin will be installed in your configured
plugin folder using the composer/installers
project., (*4)
If you are not using Composer, you can download this project and place the
entire contents in a novuso-wp-common
folder in your plugins folder. In that
case, you will need to periodically update manually (which sort of defeats the purpose)., (*5)
Usage
Just use the normal process to enqueue scripts
and styles in WordPress., (*6)
The handle names listed below are registered once the plugin is active., (*7)
Here are some examples of how to load the assets in a theme functions.php
file:, (*8)
// functions.php
function mytheme_load_assets() {
wp_enqueue_script('bootstrap');
wp_enqueue_style('bootstrap');
wp_enqueue_script('marionette');
}
add_action('wp_enqueue_scripts', 'mytheme_load_assets');
Project Maintained CSS
Project Maintained JavaScript
License
MIT, (*9)