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