NOTE
This code will load those scripts on all admin pages. Better you go through the Codex examples to get an idea how you can load the scripts on pages of specific plugins
Here’s the code to load the custom scripts on admin pages
function wpse60745_loadto_admin() {
// to load styles
wp_register_style( 'my_plugin_css', plugins_url('plugin-style.css', __FILE__) );
wp_enqueue_style( 'my_plugin_css' );
//to load javascripts
wp_register_script( 'my_plugin_js', plugins_url('plugin.js', __FILE__) );
wp_enqueue_script( 'my_plugin_js' );
}
add_action('admin_enqueue_scripts', 'wpse60745_loadto_admin');
Above code is updated
Reference
Related Posts:
- How to remove/hide action links cluttering under specific plugins’ names
- Show an image in my header.php
- Cannot access WP admin because plugin returns 204
- 404 errors when updating options in admin dashboard
- Can we hide a certain user in WP?
- Add custom WordPress admin page with pretty url via code
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Problems with installing and deleting plugins
- AdBlock blocks my non-advertising sidebar images [closed]
- Child Plugin Admin Panel
- How to display content depending on the Woocommerce Product Category
- Remove Duplicator plugin from admin menu if not an administrator
- Headers already sent when I try to add headers via a shortcode
- Input with spaces in Shortcode attributes overwritten by defaults
- Edit default comments page in WP Admin
- Add a custom form on the post-new.php admin page
- All Users > User List > Update User Meta Field Inline
- Removing customise fields during plugin uninstallation
- WordPress repository forbids me call wp-load.php in non-WordPress file
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Translating long texts with html formatting
- Rotating background images with admin options
- Is there an easy way to flag posts in the admin area?
- How would I go about creating a user ranked post popularity page?
- Anonymous Postings
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- How to hide some section in WordPress under Post
- Headers Content-Security-Policy CSP Major Issue
- Default WordPress WP Editor removing style tags and html tag
- How to debug error message: Cannot modify header information
- Disable woocommerce cookies and delete cart data automatically
- className not populating in custom block
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Run plugins only on certain pages
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- Display encrypted content on my website
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- Facebook Messager Plugin
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Polylang : Interverting languages after development [closed]
- Best place for short bio,image and button [closed]
- Use of Templates in a Plugin
- Why can’t I access my Intranet LDAPS with NADI?
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- Is it possible make a back-end for WordPress with WordPress?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- creating a custom shop page display on archive woocommerce
- Create tabs in admin options page from custom post type loop
- Setup page on first login on multisite
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- How do I make a child theme I made POST through a 3rd party plugin?
- Dynamic admin submenu
- How create Group Blogs based on user created Groups
- Remove ‘Check Compatibility’ from Plugins menu
- How to redirect users to their profile after they successfully edit their profile
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- Getting Theme element into plugins page editor in wp admin
- WordPress as web application base
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How do I apply style to each category of a list?
- Object method calling for global $wpdb in header.php
- Add category selection to custom post type (plugin)
- Add menu page issues (permissions & position)
- What does making sure “that your theme is WordPress header and footer tag enabled” mean?
- Redirect to another page using contact form 7? [closed]
- Know which plugin is calling JS in wp_head()?
- changing posts layout in ultimate member profile plugin
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Translation plugin to translate another plugins
- My single.php page does not show the related data to the post which is clicked
- Network activating; if ( !current_user_can( ‘manage_options’ ) ) locks me out…
- Login Customizer doesn’t change the background of the register form
- Cannot access my wp-admin after installing Gzip compression [closed]
- Inserting custom PHP script on homepage
- Add sub menu page in your plugin
- Enqueue stylesheet in plugin for wp-login.php
- Creating Featured Content Boxes
- Integrating WP E-commerce plugin into custom theme
- Best practice for including plugin output in a template without using shortcode?
- Custom post types – remove default post supports through empty array?