Skip to content

Commit

Permalink
Fix ajax adding of custom fields and link categories. props SergeyBir…
Browse files Browse the repository at this point in the history
…yukov. for the 3.4 branch. see #21829.

git-svn-id: http://core.svn.wordpress.org/branches/3.4@22371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Nov 5, 2012
1 parent abae837 commit 5ba6c76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wp-admin/includes/meta-boxes.php
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/includes/template.php
Expand Up @@ -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>";
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/wp-lists.dev.js
Expand Up @@ -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 )
Expand Down

0 comments on commit 5ba6c76

Please sign in to comment.