Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to run some code as soon as new image gets uploaded in wordpress 3 5 uploade


how to run some code as soon as new image gets uploaded in wordpress 3 5 uploade  using -'javascript,wordpress,file-upload,backbone.js,wordpress-3.5'

I need to run some code as soon as new images get uploaded in WordPress 3.5 uploader. Here is the code of wp-includes/js/media-views.js (line 529-540)

    uploading: function( attachment ) {
        var content = this.frame.content;

        // If the uploader was selected, navigate to the browser.
        if ( 'upload' === content.mode() )
            this.frame.content.mode('browse');

        // If we're in a workflow that supports multiple attachments,
        // automatically select any uploading attachments.
        if ( this.get('multiple') )
            this.get('selection').add( attachment );
    },


I added alert('New image uploaded!') at the bottom of this uploading function, and the browser alert 'New image uploaded!' when new image was uploaded. However I don't want to hack the core of WordPress, so I'm wondering if there is a way that I can write some code in my theme that can do the same thing? Sorry for my English. Thank you for you attention guys!
    

asked Oct 13, 2015 by vibhorsingh
0 votes
1 view



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening

answered Oct 13, 2015 by param.oncemore

...