New Feature: Earn 12 Badges

Bild

Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.

See all Badges
Add Admin JavaScript
Add Admin JavaScript

by Scott Reilly

Description
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

Free Plugin

5.0
Reviews
Last Update
3 years ago
All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. The WordPress® trademark is the intellectual property of the WordPress Foundation

Collections

Page Builder

  • 1 Plugin
  • 7 Views
Page Builder: Pagelayer – Drag and Drop website builder

payment methodes per

  • 1 Plugin
  • 2 Views
Payment Gateway Based Fees and Discounts for WooCommerce

SEO

  • 1 Plugin
  • 2 Views
Yoast SEO

Wordpress

  • 13 Plugins
  • 3 Views
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL)
Forminator Forms – Contact Form, Payment Form & Custom Form Builder
Yoast SEO
Site Kit by Google – Analytics, Search Console, AdSense, Speed

slider

  • 1 Plugin
  • 2 Views
Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery

Yeer

  • 1 Plugin
  • 3 Views
Autoptimize

Optimisation Plugins

  • 1 Plugin
  • 7 Views
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN

Best Speed Plugins

  • 4 Plugins
  • 3 Views
LiteSpeed Cache
WP Fastest Cache
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance
10Web Booster – Website speed optimization, Cache & Page Speed optimizer

Must-Have Plugins

  • 9 Plugins
  • 80 Views
Elementor Website Builder – More than Just a Page Builder
Yoast SEO
All-in-One WP Migration and Backup
Wordfence Security – Firewall, Malware Scan, and Login Security

Best Security Plugins

  • 3 Plugins
  • 3 Views
Jetpack – WP Security, Backup, Speed, & Growth
Wordfence Security – Firewall, Malware Scan, and Login Security
Solid Security – Password, Two Factor Authentication, and Brute Force Protection

Best Member Plugins

  • 5 Plugins
  • 4 Views
Paid Memberships Pro – Content Restriction, User Registration, & Paid Subscriptions
Ultimate Membership Pro - WordPress Membership Plugin
Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress

Best Recruitment Website Plugins

  • 3 Plugins
  • 5 Views
WP Job Openings – Job Listing, Career Page and Recruitment Plugin
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN
WP Job Manager

Cookie Plugins

  • 3 Plugins
  • 11 Views
CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)
Autoptimize
Complianz – GDPR/CCPA Cookie Consent

Donation Plugins

  • 2 Plugins
  • 22 Views
Charitable – Donation Plugin for WordPress – Fundraising with Recurring Donations & More
GiveWP – Donation Plugin and Fundraising Platform

Translation

  • 2 Plugins
  • 33 Views
Linguise – Automatic multilingual translation
Translate WordPress with GTranslate