Add Admin JavaScript

Add Admin JavaScript

Wordpress plugin

Install on Wordpress

App Details

Ever want to introduce custom dynamic functionality to your WordPress admin pages and otherwise harness the power of JavaScript? Any modification you may want to do with JavaScript can be facilitated via this plugin.

Using this plugin you’ll easily be able to define additional JavaScript (inline and/or by URL) to be added to all administration pages. You can define JavaScript to appear inline in the admin head, admin footer (recommended), or in the admin footer within a jQuery jQuery(document).ready(function($)) {} section, or reference JavaScript files to be linked in the page header. The referenced JavaScript files will appear in the admin head first, listed in the order defined in the plugin’s settings. Then any inline admin head JavaScript is added to the admin head. All values can be filtered for advanced customization (see Filters section).

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Hooks

The plugin exposes four filters for hooking. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). Bear in mind that most of the features controlled by these filters are configurable via the plugin’s settings page. These filters are likely only of interest to advanced users able to code.

c2c_add_admin_js_files (filter)

The ‘c2c_add_admin_js_files’ filter allows programmatic modification of the list of JavaScript files to enqueue in the admin.

Arguments:

  • $files (array): Array of JavaScript files.

Example:

/** * Adds a JavaScript file to be enqueued in the WP admin. * * @param array $files Array of files. * @return array */ function my_admin_js_files( $files ) { $files[] = 'http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/yuiloader/yuiloader-min.js'; return $files; } add_filter( 'c2c_add_admin_js_files', 'my_admin_js_files' ); 

c2c_add_admin_js_head (filter)

The ‘c2c_add_admin_js_head’ filter allows customization of the JavaScript that should be added directly to the admin page head.

Arguments:

  • $js (string): JavaScript code (without <script> tags).

Example:

/** * Adds JavaScript code to be added to the admin page head. * * @param string $js JavaScript code. * @return string */ function my_add_head_js( $js ) { $js .= "alert('Hello');"; return $js; } add_filter( 'c2c_add_admin_js_head', 'my_add_head_js' ); 

c2c_add_admin_js_footer (filter)

The ‘c2c_add_admin_js_footer’ filter allows customization of the JavaScript that should be added directly to the admin footer.

Arguments:

  • $js (string): JavaScript code (without <script> tags).

Example:

/** * Adds JavaScript code to be added to the admin footer. * * @param string $js JavaScript code. * @return string */ function my_add_footer_js( $js ) { $js .= "alert('Hello');"; return $js; } add_filter( 'c2c_add_admin_js_footer', 'my_add_footer_js' ); 

c2c_add_admin_js_jq (filter)

The ‘c2c_add_admin_js_jq’ filter allows customization of the JavaScript that should be added directly to the admin footer within a jQuery document ready function.

Arguments:

  • $jq_js (string): JavaScript code (without <script> tags or jQuery document ready function).

Example:

/** * Adds jQuery code to be added to the admin footer. * * @param string $jq_js jQuery code. * @return string */ function my_add_jq( $js_jq ) { $js_jq .= "$('.hide_me').hide();"; return $js_jq; } add_filter( 'c2c_add_admin_js_jq', 'my_add_jq' ); 

Pricing

Starting from $0 per month.

Check Out the Medium Feed Widget

By Common Ninja

Medium FeedTry For Free!

App Info

Rating

Reviewers

5 reviews

Tags

admin
admin theme
javascript
JS
script

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms