小编Alv*_*vin的帖子

如何在WordPress 3.5上传器中上传新图像后立即运行一些代码

我需要在WordPress 3.5上传器中上传新图像后立即运行一些代码.这是wp-includes/js/media-views.js的代码(第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 );
    },
Run Code Online (Sandbox Code Playgroud)

我在此上传功能的底部添加了警报('新图像已上传!'),并且浏览器提示"新图像已上传!" 上传新图片时 但是我不想破解WordPress的核心,所以我想知道是否有一种方法可以在我的主题中编写一些可以做同样事情的代码?对不起我的英语不好.谢谢你们的关注!

javascript wordpress file-upload backbone.js wordpress-3.5

6
推荐指数
1
解决办法
2310
查看次数