WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

CodeLibs

A simple plugin to add javascripts to your plugin or the theme. Useful for development work!

This section describes how to install the plugin and get it working.

  1. Upload codelibs to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Place <?php include(ABSPATH."/wp-content/plugins/codelibs/func.php"); CodeLibs('scriptname', 'version'); ?> in your templates.

MarkUp to add scripts:-

CodeLibs is a collection of all the necessary js required for development purposes. With this plugin in your blog you can use any js framework for development. And whenever you feel like you can just copy that js to your theme's or plugin's js folder. If Your plugin or theme is completely dependent on this plugin then you can ask your theme or plugin user to download this plugin as well. This plugin is created for meeting the development needs.

CodeLibs() is a Function Located in func.php file in the codelibs plugin. We are just including it and calling as many times as we want. Once you have included you can just call CodeLibs() any number of times with valid parameters.

  • just do this -
<?php include(ABSPATH."/wp-content/plugins/codelibs/func.php");
CodeLibs('scriptname', 'version'); ?>
  • or if you dont know the latest version no. just do this -
<?php include(ABSPATH."/wp-content/plugins/codelibs/func.php");
CodeLibs('scriptname', 'latest'); ?>
  • For Example, For your project if you want latest version of jQuery then do this -
<?php include(ABSPATH."/wp-content/plugins/codelibs/func.php");
CodeLibs('jQuery', '1.7.1'); ?>

OR

<?php include(ABSPATH."/wp-content/plugins/codelibs/func.php");
CodeLibs('jQuery', 'latest'); ?>
  • To Add more than one library use this simply as -
<?php include(ABSPATH."/wp-content/plugins/codelibs/func.php"); // just once
CodeLibs('jQuery', 'latest');
...
...
CodeLibs('jQueryUI','latest');
...
...
CodeLibs('URI','latest');

Requires: 3.2.1 or higher
Compatible up to: 3.3.2
Last Updated: 2012-1-11
Downloads: 1,084

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,2,2 100,1,1