mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-07 05:08:10 +02:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@12007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
19 lines
688 B
JavaScript
19 lines
688 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 );
|
|
win.cwsCloseTB();
|
|
} else {
|
|
jQuery('a.wp-post-thumbnail').text( setPostThumbnailL10n.setThumbnail );
|
|
jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').hide();
|
|
win.WPSetThumbnailID(id);
|
|
win.WPSetThumbnailHTML(str);
|
|
win.WPCloseTB();
|
|
}
|
|
}
|
|
);
|
|
} |