Wordpress plugins
Add Admin JavaScript

Add Admin JavaScript

Version : 1.4
Tested up to : 4.5.10
Number of download : 11731
Author : Scott Reilly
Average rating : 5 / 5 on 4 votes 4 votes, 5 avg.rating

Screenshots

Add Admin JavaScript
Add Admin JavaScript
Add Admin JavaScript
Add Admin JavaScript

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 | Author Homepage Filters The plugin exposes four filters for hooking. Typically, these customizations would be put into your active theme’s functions.php file, or used by another plugin. c2c_add_admin_js_files (filter) The ‘c2c_add_admin_js_files’ hook allows you to programmatically add to or customize any referenced JavaScript files defined in the “Admin JavaScript Files” field. Arguments: $files (array): Array of JavaScript files Example: add_filter( 'c2c_add_admin_js_files', 'my_admin_js_files' ); function my_admin_js_files( $files ) { $files[] = 'http://ajax.googleapis.com/ajax/libs/yui/2.8.1/build/yuiloader/yuiloader-min.js'; return $files; } c2c_add_admin_js_head (filter) The ‘c2c_add_admin_js_head’ hook allows you to programmatically add to or customize any JavaScript to be put into the page head as defined in the “Admin JavaScript (in head)” field. Arguments: $js (string): JavaScript Example: add_filter( 'c2c_add_admin_js_head', 'my_add_head_js' ); function my_add_head_js( $js ) { $js .= "alert('Hello');"; return $js; } c2c_add_admin_js_footer (filter) The ‘c2c_add_admin_js_footer’ hook allows you to programmatically add to or customize any JavaScript to be put into the page head as defined in the “Admin JavaScript (in footer)” field. Arguments: $js (string): JavaScript Example: add_filter( 'c2c_add_admin_js_footer', 'my_add_footer_js' ); function my_add_footer_js( $js ) { $js .= "alert('Hello');"; return $js; } c2c_add_admin_js_jq (filter) The ‘c2c_add_admin_js_jq’ hook allows you to filter the jQuery JavaScript to be output in the footer of admin pages. The ‘c2c_add_admin_js_jq’ hook allows you to programmatically add to or customize any jQuery JS to be put into the page footer as defined in the “Admin jQuery JavaScript” field. Arguments: $js_jq (string): String of jQuery JavaScript Example: add_filter( 'c2c_add_admin_js_jq', 'my_add_jq' ); function my_add_jq( $js_jq ) { $js_jq .= "$('.hide_me').hide();"; return $js_jq; }

Download now