Can I use the Backbone REST API client outside WordPress?

I haven’t tried this directly, but I’m pretty positive you can — after all, it’s a Javascript library. As long as you: Load any required dependencies; Provide any settings expected by the library; You should be good. A quick code search brings up these results from the /wp-includes/script-loader.php file: $scripts->add( ‘wp-api’, “/wp-includes/js/wp-api$suffix.js”, array( ‘jquery’, ‘backbone’, … Read more

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