Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Javascript Reference

This page is marked as incomplete. You can help Codex by expanding it.


This page documents the JavaScript APIs available to WordPress plugin developers, and how to use them.

This article assumes you have already read Writing a Plugin, which gives an overview (and many details) of how to develop a plugin, and that you already have a firm understanding of object-oriented JavaScript.


Most of WordPress's JavaScript files can be found in two locations.

Global JavaScript
Scripts for use anywhere are located in wp-includes/js/
Admin JavaScript
Scripts for use in admin are located in wp-admin/js/

Core Admin Libraries

  • wp (object) - The namespace object for nearly all WordPress scripts
  • wp.media - Handles the interactive media library

3rd Party Libraries

The following 3rd party libraries are included with WordPress.

php Support Functions

Used to register a script with WordPress without enqueuing
Used to de-register a script with WordPress without enqueuing
Used to add a script to WordPress's rendering queue
Used to remove a script from WordPress's rendering queue
Determines the status of a script: whether it's been registered, enqueued, or printed/rendered.
Used to output PHP as JavaScript, typically so that JavaScript text can be localized.
Used to force all WordPress media-management assets to be loaded, generally used when you need to access the media scripts and libraries on screens where they are not automatically enqueued.