X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-admin/js/custom-fields.js?ds=sidebyside diff --git a/wp-admin/js/custom-fields.js b/wp-admin/js/custom-fields.js index 9eab2145..e69de29b 100644 --- a/wp-admin/js/custom-fields.js +++ b/wp-admin/js/custom-fields.js @@ -1,34 +0,0 @@ -jQuery(document).ready( function($) { - var before, addBefore, addAfter, delBefore; - - before = function() { - var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val(); - if ( !nonce || !postId ) { return false; } - return [nonce,postId]; - } - - addBefore = function( s ) { - var b = before(); - if ( !b ) { return false; } - s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1]; - return s; - }; - - addAfter = function( r, s ) { - var postId = $('postid', r).text(), h; - if ( !postId ) { return; } - $('#post_ID').attr( 'name', 'post_ID' ).val( postId ); - h = $('#hiddenaction'); - if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); } - }; - - delBefore = function( s ) { - var b = before(); if ( !b ) return false; - s.data._ajax_nonce = b[0]; s.data.post_id = b[1]; - return s; - } - - $('#the-list') - .wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } ) - .find('.updatemeta, .deletemeta').attr( 'type', 'button' ); -} );