-
+ 5F941C6E1ACA63EA206E2B919CB9840B7016B42BD446F5DE435074128B3EFEB596A1A54AA3924ED0A53251D8FAF077D363953308F134E8597BEC2BDEAD205357
mp-wp/wp-admin/js/custom-fields.js
(0 . 0)(1 . 33)
48880 jQuery( function($) {
48881 var before = function() {
48882 var nonce = $('#newmeta [@name=_ajax_nonce]').val();
48883 var postId = $('#post_ID').val();
48884 if ( !nonce || !postId ) { return false; }
48885 return [nonce,postId];
48886 }
48887
48888 var addBefore = function( s ) {
48889 var b = before();
48890 if ( !b ) { return false; }
48891 s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
48892 return s;
48893 };
48894
48895 var addAfter = function( r, s ) {
48896 var postId = $('postid', r).text();
48897 if ( !postId ) { return; }
48898 $('#post_ID').attr( 'name', 'post_ID' ).val( postId );
48899 var h = $('#hiddenaction');
48900 if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
48901 };
48902
48903 var delBefore = function( s ) {
48904 var b = before(); if ( !b ) return false;
48905 s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
48906 return s;
48907 }
48908
48909 $('#the-list')
48910 .wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
48911 .find('.updatemeta, .deletemeta').attr( 'type', 'button' );
48912 } );