mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-12 07:38:33 +02:00
Props johnbillion, mordauk, valendesigns. Fixes #19257. Built from https://develop.svn.wordpress.org/trunk@32673 git-svn-id: http://core.svn.wordpress.org/trunk@32643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
565 B
JavaScript
1 line
565 B
JavaScript
function WPSetAsThumbnail(a,b){var c=jQuery("a#wp-post-thumbnail-"+a);c.text(setPostThumbnailL10n.saving),jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:a,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(b){var d=window.dialogArguments||opener||parent||top;setThumbnail="setThumbnail_"+post_type,c.text(setPostThumbnailL10n[setThumbnail]),"0"==b?alert(setPostThumbnailL10n.error):(jQuery("a.wp-post-thumbnail").show(),c.text(setPostThumbnailL10n.done),c.fadeOut(2e3),d.WPSetThumbnailID(a),d.WPSetThumbnailHTML(b))})} |