Fix adding and updating from the Custom Fields meta box. Broken in [21205]. props SergeyBiryukov. see #21829 for trunk.

git-svn-id: http://core.svn.wordpress.org/trunk@21781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-07 15:49:20 +00:00
parent a282823b17
commit aa543734b8
3 changed files with 4 additions and 4 deletions

View File

@ -3200,7 +3200,7 @@ td.plugin-title p {
}
#postcustomstuff .submit input,
#postcustomstuff table #addmetasub {
#postcustomstuff table #newmeta-submit {
width: auto;
}

View File

@ -493,7 +493,7 @@ function _list_meta_row( $entry, &$count ) {
$r .= "\n\t\t<div class='submit'>";
$r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta", "deletemeta[{$entry['meta_id']}]", false );
$r .= "\n\t\t";
$r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , 'updatemeta', false );
$r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , "meta-{$entry['meta_id']}-submit", false );
$r .= "</div>";
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
$r .= "</td>";
@ -554,7 +554,7 @@ function meta_form() {
</tr>
<tr><td colspan="2" class="submit">
<?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'addmetasub' ) ); ?>
<?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'newmeta-submit' ) ); ?>
<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
</td></tr>
</tbody>

View File

@ -78,7 +78,7 @@ wpList = {
if ( !s )
return false;
if ( !e.is('[id="' + s.what + '-add-submit"]') )
if ( !e.is('[id="' + s.element + '-submit"]') )
return !wpList.add.call( list, e, s );
if ( !s.element )