equal
deleted
inserted
replaced
1 function WPSetAsThumbnail(id){ |
1 function WPSetAsThumbnail(id, nonce){ |
2 var $link = jQuery('a#wp-post-thumbnail-' + id); |
2 var $link = jQuery('a#wp-post-thumbnail-' + id); |
3 |
3 |
4 $link.text( setPostThumbnailL10n.saving ); |
4 $link.text( setPostThumbnailL10n.saving ); |
5 jQuery.post(ajaxurl, { |
5 jQuery.post(ajaxurl, { |
6 action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie) |
6 action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie) |
7 }, function(str){ |
7 }, function(str){ |
8 var win = window.dialogArguments || opener || parent || top; |
8 var win = window.dialogArguments || opener || parent || top; |
9 $link.text( setPostThumbnailL10n.setThumbnail ); |
9 $link.text( setPostThumbnailL10n.setThumbnail ); |
10 if ( str == '0' ) { |
10 if ( str == '0' ) { |
11 alert( setPostThumbnailL10n.error ); |
11 alert( setPostThumbnailL10n.error ); |