mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-13 03:40:45 +01:00
2fa9ebab8f
git-svn-id: http://svn.automattic.com/wordpress/trunk@12037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
17 lines
647 B
JavaScript
17 lines
647 B
JavaScript
function WPSetAsThumbnail(id){
|
|
jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').text( setPostThumbnailL10n.saving ).attr('href', '#');
|
|
jQuery.post(ajaxurl, {
|
|
action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie)
|
|
}, function(str){
|
|
var win = window.dialogArguments || opener || parent || top;
|
|
if ( str == '0' ) {
|
|
alert( setPostThumbnailL10n.error );
|
|
} else {
|
|
jQuery('a.wp-post-thumbnail').text( setPostThumbnailL10n.setThumbnail );
|
|
jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').hide();
|
|
win.WPSetThumbnailID(id);
|
|
win.WPSetThumbnailHTML(str);
|
|
}
|
|
}
|
|
);
|
|
} |