CoreFiles by mySites.guru
set-post-thumbnail.js24 lines, 777 bytes, from wordpress-4.2.21.zip
Raw History Compare with 4.2.20
md5
2b5153576d1eee4002fb7ed9e5831251
sha1
957b0b376a98d0b4f995175ab5d5026c1ffe0bf8
sha256
2d58156ad35515994b41706d87b5df84e5d208bb38f35380540a94acb170cb20
/* global setPostThumbnailL10n, ajaxurl, post_id, alert */
/* exported WPSetAsThumbnail */

function WPSetAsThumbnail( id, nonce ) {
	var $link = jQuery('a#wp-post-thumbnail-' + id);

	$link.text( setPostThumbnailL10n.saving );
	jQuery.post(ajaxurl, {
		action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
	}, function(str){
		var win = window.dialogArguments || opener || parent || top;
		$link.text( setPostThumbnailL10n.setThumbnail );
		if ( str == '0' ) {
			alert( setPostThumbnailL10n.error );
		} else {
			jQuery('a.wp-post-thumbnail').show();
			$link.text( setPostThumbnailL10n.done );
			$link.fadeOut( 2000 );
			win.WPSetThumbnailID(id);
			win.WPSetThumbnailHTML(str);
		}
	}
	);
}

The same content is in 591 releases, WordPress 3.8-beta-1 to 5.0.31. See them all, or every version of this file.