Hook into backbone to add js to wp-admin -> media library?

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’); … Read more

Replace Underscore (_) on Space ( )

You are correct, you need to use str_replace. See details here So the correct code would be: $postData = array( ‘post_title’ => str_replace(‘_’, ‘ ‘, $attachment->post_title), ‘post_type’ => ‘post’, ‘post_content’ => $image_tag, ‘post_category’ => array(‘0’), ‘post_status’ => ‘publish’ );

underscore template dynamically remove row Jquery

This isn’t WP related but Its not working because you are trying to add an event to a dynamically created element. Replace… jQuery( ‘.remove_field’ ).on(“click”, function(e){ e.preventDefault(); jQuery(this).parent(‘div’).remove(); }); With jQuery( ‘body’ ).on(“click”, ‘.remove_field’, function(e){ e.preventDefault(); jQuery(this).parent(‘div’).remove(); }); You can read more about your issue here.

How to Dequeue All WordPress Assets

I’m not sure what more you need that the example there, and remember that some scripts are needed for stuff like the admin bar and are not enqueued if you are not logged in. function wpdocs_dequeue_script() { wp_dequeue_script( ‘jquery-ui-core’ ); } add_action( ‘wp_print_scripts’, ‘wpdocs_dequeue_script’, 100 ); This will dequeue the jquery-ui-core js. Adding more lines … Read more