Changeset 41684
- Timestamp:
- 10/02/2017 09:51:09 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/ie.css
r41563 r41684 286 286 } 287 287 288 .inline-edit-row p.submit {288 .inline-edit-row .submit { 289 289 zoom: 100%; 290 290 } -
trunk/src/wp-admin/css/list-tables.css
r41648 r41684 151 151 padding: 5px 7px 10px; 152 152 overflow: hidden; 153 text-align: center;154 153 } 155 154 156 155 #replysubmit .button { 157 156 margin-right: 5px; 158 }159 160 #replysubmit .error {161 color: red;162 line-height: 21px;163 text-align: center;164 157 } 165 158 … … 958 951 } 959 952 960 .inline-edit-row p.submit {953 .inline-edit-row .submit { 961 954 clear: both; 962 955 padding: 0.5em; … … 964 957 } 965 958 966 .inline-edit-row span.error { 967 line-height: 22px; 968 margin: 0 15px; 969 padding: 3px 5px; 959 .inline-edit-row .notice-error { 960 margin-top: 1em; 961 } 962 963 .inline-edit-row .notice-error .error { 964 margin: 0.5em 0; 965 padding: 2px; 970 966 } 971 967 -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r41683 r41684 1738 1738 } 1739 1739 ?> 1740 < pclass="submit inline-edit-save">1740 <div class="submit inline-edit-save"> 1741 1741 <button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button> 1742 1742 <?php if ( ! $bulk ) { … … 1753 1753 <input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" /> 1754 1754 <?php } ?> 1755 <span class="error" style="display:none"></span>1756 1755 <br class="clear" /> 1757 </p> 1756 <div class="notice notice-error notice-alt inline hidden"> 1757 <p class="error"></p> 1758 </div> 1759 </div> 1758 1760 </td></tr> 1759 1761 <?php -
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r41161 r41684 617 617 ?> 618 618 619 < pclass="inline-edit-save submit">619 <div class="inline-edit-save submit"> 620 620 <button type="button" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></button> 621 621 <button type="button" class="save button button-primary alignright"><?php echo $tax->labels->update_item; ?></button> 622 622 <span class="spinner"></span> 623 <span class="error" style="display:none;"></span>624 623 <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?> 625 624 <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $this->screen->taxonomy ); ?>" /> 626 625 <input type="hidden" name="post_type" value="<?php echo esc_attr( $this->screen->post_type ); ?>" /> 627 626 <br class="clear" /> 628 </p> 627 <div class="notice notice-error notice-alt inline hidden"> 628 <p class="error"></p> 629 </div> 630 </div> 629 631 </td></tr> 630 632 </tbody></table></form> -
trunk/src/wp-admin/includes/template.php
r41399 r41684 424 424 </div> 425 425 426 <p id="replysubmit" class="submit"> 427 <a href="#comments-form" class="save button button-primary alignright"> 428 <span id="addbtn" style="display:none;"><?php _e('Add Comment'); ?></span> 429 <span id="savebtn" style="display:none;"><?php _e('Update Comment'); ?></span> 430 <span id="replybtn" style="display:none;"><?php _e('Submit Reply'); ?></span></a> 431 <a href="#comments-form" class="cancel button alignleft"><?php _e('Cancel'); ?></a> 432 <span class="waiting spinner"></span> 433 <span class="error" style="display:none;"></span> 434 </p> 426 <div id="replysubmit" class="submit"> 427 <p> 428 <a href="#comments-form" class="save button button-primary alignright"> 429 <span id="addbtn" style="display: none;"><?php _e( 'Add Comment' ); ?></span> 430 <span id="savebtn" style="display: none;"><?php _e( 'Update Comment' ); ?></span> 431 <span id="replybtn" style="display: none;"><?php _e( 'Submit Reply' ); ?></span> 432 </a> 433 <a href="#comments-form" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></a> 434 <span class="waiting spinner"></span> 435 </p> 436 <br class="clear" /> 437 <div class="notice notice-error notice-alt inline hidden"> 438 <p class="error"></p> 439 </div> 440 </div> 435 441 436 442 <input type="hidden" name="action" id="action" value="" /> … … 893 899 * (such as a post type, 'link', or 'comment'). Accepts a single 894 900 * screen ID, WP_Screen object, or array of screen IDs. Default 895 * is the current screen. If you have used add_menu_page() or 901 * is the current screen. If you have used add_menu_page() or 896 902 * add_submenu_page() to create a new screen (and hence screen_id), 897 903 * make sure your menu slug conforms to the limits of sanitize_key() -
trunk/src/wp-admin/js/edit-comments.js
r40297 r41684 654 654 $('#replycontent').css('height', '').val(''); 655 655 $('#edithead input').val(''); 656 $('.error', replyrow).empty().hide(); 656 $( '.notice-error', replyrow ) 657 .addClass( 'hidden' ) 658 .find( '.error' ).empty(); 657 659 $( '.spinner', replyrow ).removeClass( 'is-active' ); 658 660 … … 755 757 756 758 send : function() { 757 var post = {}; 758 759 $('#replysubmit .error').hide(); 759 var post = {}, 760 $errorNotice = $( '#replysubmit .error-notice' ); 761 762 $errorNotice.addClass( 'hidden' ); 760 763 $( '#replysubmit .spinner' ).addClass( 'is-active' ); 761 764 … … 848 851 849 852 error : function(r) { 850 var er = r.statusText; 853 var er = r.statusText, 854 $errorNotice = $( '#replysubmit .notice-error' ), 855 $error = $errorNotice.find( '.error' ); 851 856 852 857 $( '#replysubmit .spinner' ).removeClass( 'is-active' ); … … 855 860 er = r.responseText.replace( /<.[^<>]*?>/g, '' ); 856 861 857 if ( er ) 858 $('#replysubmit .error').html(er).show(); 859 862 if ( er ) { 863 $errorNotice.removeClass( 'hidden' ); 864 $error.html( er ); 865 } 860 866 }, 861 867 -
trunk/src/wp-admin/js/inline-edit-post.js
r40796 r41684 414 414 $.post( ajaxurl, params, 415 415 function(r) { 416 var $errorSpan = $( '#edit-' + id + ' .inline-edit-save .error' ); 416 var $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ), 417 $error = $errorNotice.find( '.error' ); 417 418 418 419 $( 'table.widefat .spinner' ).removeClass( 'is-active' ); … … 430 431 } else { 431 432 r = r.replace( /<.[^<>]*?>/g, '' ); 432 $errorSpan.html( r ).show(); 433 wp.a11y.speak( $errorSpan.text() ); 433 $errorNotice.removeClass( 'hidden' ); 434 $error.html( r ); 435 wp.a11y.speak( $error.text() ); 434 436 } 435 437 } else { 436 $errorSpan.html( inlineEditL10n.error ).show(); 438 $errorNotice.removeClass( 'hidden' ); 439 $error.html( inlineEditL10n.error ); 437 440 wp.a11y.speak( inlineEditL10n.error ); 438 441 } -
trunk/src/wp-admin/js/inline-edit-tax.js
r38644 r41684 197 197 function(r) { 198 198 var row, new_id, option_value, 199 $errorSpan = $( '#edit-' + id + ' .inline-edit-save .error' ); 199 $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ), 200 $error = $errorNotice.find( '.error' ); 200 201 201 202 $( 'table.widefat .spinner' ).removeClass( 'is-active' ); … … 226 227 227 228 } else { 228 $errorSpan.html( r ).show(); 229 $errorNotice.removeClass( 'hidden' ); 230 $error.html( r ); 229 231 /* 230 232 * Some error strings may contain HTML entities (e.g. `“`), let's use 231 233 * the HTML element's text. 232 234 */ 233 wp.a11y.speak( $error Span.text() );235 wp.a11y.speak( $error.text() ); 234 236 } 235 237 } else { 236 $errorSpan.html( inlineEditL10n.error ).show(); 238 $errorNotice.removeClass( 'hidden' ); 239 $error.html( inlineEditL10n.error ); 237 240 wp.a11y.speak( inlineEditL10n.error ); 238 241 } -
trunk/src/wp-includes/taxonomy.php
r41674 r41684 425 425 // Do not allow unregistering internal taxonomies. 426 426 if ( $taxonomy_object->_builtin ) { 427 return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed ' ) );427 return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) ); 428 428 } 429 429 … … 747 747 function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { 748 748 if ( empty( $term ) ) { 749 return new WP_Error( 'invalid_term', __( 'Empty Term ' ) );749 return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 750 750 } 751 751 … … 2124 2124 2125 2125 if ( false === $wpdb->insert( $wpdb->terms, $data ) ) { 2126 return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database ' ), $wpdb->last_error );2126 return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database.' ), $wpdb->last_error ); 2127 2127 } 2128 2128 … … 2348 2348 if ( $values ) 2349 2349 if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)" ) ) 2350 return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database ' ), $wpdb->last_error );2350 return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error ); 2351 2351 } 2352 2352 … … 2616 2616 2617 2617 if ( ! $term ) { 2618 return new WP_Error( 'invalid_term', __( 'Empty Term ' ) );2618 return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 2619 2619 } 2620 2620 … … 2702 2702 } else { 2703 2703 /* translators: 1: Taxonomy term slug */ 2704 return new WP_Error( 'duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug));2704 return new WP_Error( 'duplicate_term_slug', sprintf( __( 'The slug “%s” is already in use by another term.' ), $slug ) ); 2705 2705 } 2706 2706 } … … 3917 3917 3918 3918 if ( !is_object($term) ) 3919 $term = new WP_Error( 'invalid_term', __('Empty Term'));3919 $term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 3920 3920 3921 3921 if ( is_wp_error( $term ) ) … … 4129 4129 function is_object_in_term( $object_id, $taxonomy, $terms = null ) { 4130 4130 if ( !$object_id = (int) $object_id ) 4131 return new WP_Error( 'invalid_object', __( 'Invalid object ID ' ) );4131 return new WP_Error( 'invalid_object', __( 'Invalid object ID.' ) ); 4132 4132 4133 4133 $object_terms = get_object_term_cache( $object_id, $taxonomy ); -
trunk/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php
r40417 r41684 52 52 $this->assertIXRError( $result ); 53 53 $this->assertEquals( 500, $result->code ); 54 $this->assertEquals( __('Empty Term '), $result->message );54 $this->assertEquals( __('Empty Term.'), $result->message ); 55 55 } 56 56 -
trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php
r41575 r41684 69 69 $this->assertIXRError( $result ); 70 70 $this->assertEquals( 500, $result->code ); 71 $this->assertEquals( __('Empty Term '), $result->message );71 $this->assertEquals( __('Empty Term.'), $result->message ); 72 72 } 73 73 … … 134 134 $this->assertIXRError( $result ); 135 135 $this->assertEquals( 500, $result->code ); 136 $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term '), $parent_term->slug ) ), $result->message );136 $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term.'), $parent_term->slug ) ), $result->message ); 137 137 } 138 138 -
trunk/tests/phpunit/tests/xmlrpc/wp/getTerm.php
r40916 r41684 54 54 $this->assertIXRError( $result ); 55 55 $this->assertEquals( 500, $result->code ); 56 $this->assertEquals( __('Empty Term '), $result->message );56 $this->assertEquals( __('Empty Term.'), $result->message ); 57 57 } 58 58
Note: See TracChangeset
for help on using the changeset viewer.