3 $( 'body' ).bind( 'click.wp-gallery', function(e){
4 var target = $( e.target ), id, img_size;
6 if ( target.hasClass( 'wp-set-header' ) ) {
7 ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
9 } else if ( target.hasClass( 'wp-set-background' ) ) {
10 id = target.data( 'attachment-id' );
11 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
13 jQuery.post(ajaxurl, {
14 action: 'set-background-image',
18 var win = window.dialogArguments || opener || parent || top;
20 win.location.reload();