Respect post_ID update when doing multiple add meta AJAX requests. Props mdawaffe. fixes #7170 see #6457 for 2.5

git-svn-id: http://svn.automattic.com/wordpress/branches/2.5@8178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-06-23 23:27:07 +00:00
parent 9540ab9d33
commit cffdcdb09c
2 changed files with 6 additions and 2 deletions

View File

@ -823,7 +823,7 @@ function meta_form() {
</tr>
<tr class="submit"><td colspan="3">
<?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?>
<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta::post_id=<?php echo $GLOBALS['post_ID'] ? $GLOBALS['post_ID'] : $GLOBALS['temp_ID']; ?>" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
</td></tr>
</table>
<?php

View File

@ -177,5 +177,9 @@ jQuery(document).ready( function() {
if ( jQuery.isFunction( autosave_update_post_ID ) ) {
autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
}
} });
}, addBefore: function( s ) {
s.data += '&post_id=' + jQuery('#post_ID').val();
return s;
}
});
});