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
- Best collection of code for your 'functions.php' file [closed]
- Should all plugins be encapsulated in a Class?
- How can I delete orphan keys in WordPress database tables?
- OpenID for WordPress 3.x? [duplicate]
- Get a button for in the Editor
- Plugin: How to make links in admin page open up inside of the admin panel
- Change My Basket text in the header of WooCommerce Artificer theme
- Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload
- WP get_permalink Return Wrong URL
- How to add product images using script?
- Setting up widgets in wordpress with a unique ID for the after_title argument
- MailChimp integration that allows users to select from multiple lists [closed]
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- Use plugin or custom post type for game score functionality
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- How to add rewrite rules and pagination to retrieve attachments files?
- Hide Theme options and Customize Admin menu
- Copyright messages for a particular set of pages
- How to provide a plugin which requires CMB2 (plugin dependencies)?
- how to load the language file in plugin?
- View Private Published Page with URL Code (no login required)
- Translating long texts with html formatting
- Do widget options need to be escaped widget()?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- Headers Content-Security-Policy CSP Major Issue
- custom payment gateway in woocommerce failed to connect to remote api server
- Send reply with pre-prepared answers
- Is it possible make a back-end for WordPress with WordPress?
- Anspress Customization: How to show logged in user votes on a single answer?
- How create Group Blogs based on user created Groups
- Remove ‘Check Compatibility’ from Plugins menu
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- My single.php page does not show the related data to the post which is clicked
- Cannot access my wp-admin after installing Gzip compression [closed]
- Inserting custom PHP script on homepage
- Enqueue stylesheet in plugin for wp-login.php
- Best practice for including plugin output in a template without using shortcode?
- Plugin settings won’t save changes
- a weird attribute on every html tag
- How to change the wp_upload_dir() path in plugin
- Odd /wp-admin/admin-ajax.php entries showing in Wassup
- Disable plugin only for one post
- Is there a plugin for WordPress for creating ‘Accounts’ where all users who belong to that Account can only see Account data? [closed]
- I am trying to make a field show and save from quickedit screen
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- Advanced WordPress plugin activation detection
- How to remove a CPT Menu from the Root Admin only
- how to change wp-admin url using function file
- Calling a save function from a “submit” button
- Is there a way to easily manage Project options (custom-fields)
- Renaming Custom Taxonomy Values
- Add a “default sorting” menu to child store pages
- Install old version of plugin from admin panel?
- Plugin code will not work properly inside a class [closed]
- Gathering all Custom Post Type posts in to array/object the proper way
- Multiple Post Thumbnails Plugin – Need help with code
- How do I fill the Home Description?
- Custom Post Type, Custom Columns List
- How to prevent plugin, theme installation failures on WordPress?
- How to make a slider hearder?
- WordPress search input in database, to edit information via form and update the database
- Adding category base to url in custom post giving 404?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function
- Post source link plugin – small modification
- How Can I Increase Breadcrumb Position Count (Starting From 2)?
- WordPress Dashboard add user password not working, etc
- Load my Inline js footer area
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Woocommerce list variations that are added already to cart in Single Product
- Flexslider empty slide
- How to fix slow comment query?
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- Share on social media created listing after submission
- Translation plugin with default language?
- Primary Menu doesn’t show because of w3 cache
- Custom pages with plugin
- WP plugin calls for custom pages
- Changing the body of mail sent to new user registration
- Which One Is Better For Managing Add Ons For Extensible Plugin?
- How to add php stylesheet to admin section instead of admin_head hook
- Change text “My Basket” in woocommerce artificer theme
- Posts are deleted everyday at night
- Screen Options drop-down does not show
- WordPress Code Access to Restricted Content without Registration
- What can I do to customize a widget provided with this plugin? from where have I to start?
- How to pre-set WordPress settings for specific posts?
- plugin translations not reflected in admin dashboard
- How to disable plugin capability : “create new category”