Fix ajax adding of custom fields and link categories. props SergeyBiryukov. for the 3.4 branch. see #21829.

git-svn-id: https://develop.svn.wordpress.org/branches/3.4@22371 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-05 17:47:55 +00:00
parent 72dc96da63
commit 37d6416d2f
3 changed files with 4 additions and 4 deletions

View File

@ -688,7 +688,7 @@ function link_categories_meta_box($link) {
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="link-category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
<input type="button" id="link-category-add-submit" class="add:categorychecklist:link-category-add button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>

View File

@ -494,7 +494,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, array( 'tabindex' => '6' ) );
$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, array( 'tabindex' => '6' ) );
$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, array( 'tabindex' => '6' ) );
$r .= "</div>";
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
$r .= "</td>";
@ -555,7 +555,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', 'tabindex' => '9' ) ); ?>
<?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'newmeta-submit', 'tabindex' => '9' ) ); ?>
<?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 )