You can enqueue javascript files and css files like this for wp admin:-
function load_custom_wp_admin_style() {
wp_enqueue_script( 'script-name','js/scripts.js', array('jquery'), '3.3.5', true );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
First you need to enqueue admin scripts like below:-
function my_admin_scripts() {
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
}
function my_admin_styles() {
wp_enqueue_style('thickbox');
}
for uploading attachment:-
$('.upload_image_button').live('click',function() {
formfield = $('#upload_image').attr('name');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
return false;
});
window.send_to_editor = function(html) {
imgurl = $('img',html).attr('src');
tb_remove();
}
I have used my code, you can modify it.
Thanks
Related Posts:
- Programtically selecting image URL in Media Library modal
- Organising and display thousands of photos in media library
- Images on admin backend not showing up
- How to increase the file size limit for media uploads?
- How to hook in and modify the new revisions UI (3.6+)?
- Open media frame and select an attachment
- sortable custom column in media library
- How to get the post editor and media library to respect HTTPS administration mode?
- Can I add custom attributes while adding inline scripts?
- Disable slow media queries?
- Can initial focus be set to search field in WordPress Media Library?
- Looking for a hook to add attachment information to the media library tab
- Upload media file problem
- Image editing: “Edit Original” and “Replace” buttons missing on old posts
- How To Reset Ownership And Permissions of Wp-Content Folder, In Order to Fix HTTP Error When Uploading Images to WordPress Media Library
- How do I change the upload file size limit in single-site wordpress install?
- Why is unfiltered_upload not working despite being enabled?
- How to use underscore.js in WordPress Admin
- Minimum version for WordPress Backbone
- Detect Featured Image remove while editing post in wp-admin (client-side)
- Am I able to change the name of /wp-admin/options-general.php?
- How to make Media Library use HTTPS?
- How to Filter in the “Add Media Popup” to show only “unattached” Media
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- Media library to list images only user uploaded
- How to display a static HTML page while setting up a WordPress site?
- How can I uninstall a language?
- js error on post editing page
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to add a custom metabox to the Menu Management admin screen?
- How to hide media uploads by other users in the Media menu?
- How to change the wording in wp-admin back-end?
- How to make ajax call in wordpress in right way?
- Delete Post From front Page ( With Wp-admin restriction )
- Bulk Delete Users Error uri too large
- Add column to pages table
- Adding fields to the media uploader with jquery listeners
- Change the Return URL from the Customizer
- Where can I edit Admin Panel Page file
- Access to Media Library
- Replace wordpress login logo with custom text
- Failed to load resource admin-ajax.php
- Custom WordPress Dashboard for Specific user role
- 404 of wp-admin pages [closed]
- How to Dequeue All WordPress Assets
- Execute script only on certain admin pages
- Uncheck the box “Send User Notification” by default on new-user.php
- Sortable columns and admin like interface for tables/report in custom plugin?
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- How organize uploaded media in WP?
- Large Media Library
- Remove favorites action menu and screen options panel
- No access local wordpress website after PC formating
- Overriding of the template for the Attachment “thumbnails” in the Media Grid isn’t working
- is_admin() not working when updating a post in the admin panel
- Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)
- Using wp_enqueue_media() with switch_to_blog() issue
- How can I replace dashboard.css and dashboard.min.css (not add new css)
- ‘wp’ hook supposed to trigger when editing a post?
- How to remove dashboard access (wp-admin) for author but not disable the capabilities?
- always by default show welcome panel in the dashboard
- Remove delete-attachment button for every media
- Dashboard Widget CSS
- How can I prevent a function from loading in the admin screens?
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- Move WooCommerce menu entries to top of dashboard
- WP Core hard coded to use http://www.w3.org/1999/xhtml not HTTPS
- 404 Admin Error
- Fix Admin Dashboard Posts tab
- Change maxlength of link_description in dashbord link section?
- Add a custom field when adding / editing a page / post in admin panel
- get all images from the wordpress media library with link to the post they are associated with
- Should I move wp-admin to a separated server? How to do it?
- WP-Admin throws 404 after changing wp-config Salts
- How to create a new section on the wordpress admin dashboard?
- What event I can tap into that fires before loading wp-admin page?
- Weird white space in admin area
- How to fix the view of admin all posts
- mixed contents admin panel is Unsecured
- Link with password is not sent to the new user
- Images not displaying on site or media library
- Media Library Mess After FTP … /uploads
- Can I rename the wp-admin folder?
- How do I list subpages in post editor view?
- Remove View details option from plugin listing
- Insert Link to Audio versus Embed Audio Player
- Media not displaying other users uploads – WordPress 4.9.2
- WordPress wp-admin login problem
- Why does my edit screen suddenly have such a buggy interface?
- WordPress uploads do not show up and I see the white screen of death in some cases
- Disabling WP-Admin Caching in htaccess
- WordPress Child problem in admin
- SSL doesn’t deliver parts of WordPress Administration Module
- How to split my uploaded media into directories?
- Is it possible to change the images source that are shown in the admin side?
- Why some images are not allowed to be edited only for thumbnails?
- How to batch-add image file extension without losing DB refs?
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box
- Cannot Access wp-admin