Ticket #35496: 35496.diff
File 35496.diff, 15.1 KB (added by , 7 years ago) |
---|
-
src/wp-admin/css/ie.css
285 285 width: 29%; 286 286 } 287 287 288 .inline-edit-row p.submit {288 .inline-edit-row .submit { 289 289 zoom: 100%; 290 290 } 291 291 -
src/wp-admin/css/list-tables.css
150 150 margin: 0; 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 157 } 159 158 160 #replysubmit .error {161 color: red;162 line-height: 21px;163 text-align: center;164 }165 166 159 #replyrow.inline-edit-row fieldset.comment-reply { 167 160 font-size: inherit; 168 161 line-height: inherit; … … 957 950 line-height: 2.5; 958 951 } 959 952 960 .inline-edit-row p.submit {953 .inline-edit-row .submit { 961 954 clear: both; 962 955 padding: 0.5em; 963 956 margin: 0.5em 0 0; 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; 970 961 } 971 962 963 .inline-edit-row .notice-error .error { 964 margin: 0.5em 0; 965 padding: 2px; 966 } 967 972 968 /* Positioning */ 973 969 974 970 /* Needs higher specificity for the padding */ -
src/wp-admin/includes/class-wp-posts-list-table.php
1732 1732 1733 1733 } 1734 1734 ?> 1735 < pclass="submit inline-edit-save">1735 <div class="submit inline-edit-save"> 1736 1736 <button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button> 1737 1737 <?php if ( ! $bulk ) { 1738 1738 wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); … … 1747 1747 <?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) { ?> 1748 1748 <input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" /> 1749 1749 <?php } ?> 1750 <span class="error" style="display:none"></span>1751 1750 <br class="clear" /> 1752 </p> 1751 <div class="notice notice-error inline hidden"> 1752 <p class="error"></p> 1753 </div> 1754 </div> 1753 1755 </td></tr> 1754 1756 <?php 1755 1757 $bulk++; -
src/wp-admin/includes/class-wp-terms-list-table.php
616 616 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 inline hidden"> 628 <p class="error"></p> 629 </div> 630 </div> 629 631 </td></tr> 630 632 </tbody></table></form> 631 633 <?php -
src/wp-admin/includes/template.php
423 423 </div> 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 inline hidden"> 438 <p class="error"></p> 439 </div> 440 </div> 435 441 436 442 <input type="hidden" name="action" id="action" value="" /> 437 443 <input type="hidden" name="comment_ID" id="comment_ID" value="" /> … … 892 898 * @param string|array|WP_Screen $screen Optional. The screen or screens on which to show the box 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() 898 904 * otherwise the 'screen' menu may not correctly render on your page. -
src/wp-admin/js/edit-comments.js
653 653 $('#com-reply').append( replyrow ); 654 654 $('#replycontent').css('height', '').val(''); 655 655 $('#edithead input').val(''); 656 $('.error', replyrow).empty().hide(); 656 $( '.notice-error', replyrow ).addClass( 'hidden' ); 657 $( '.notice-error .error', replyrow ).empty(); 657 658 $( '.spinner', replyrow ).removeClass( 'is-active' ); 658 659 659 660 this.cid = ''; … … 754 755 }, 755 756 756 757 send : function() { 757 var post = {}; 758 var post = {}, 759 $errorNotice = $( '#replysubmit .error-notice' ); 758 760 759 $ ('#replysubmit .error').hide();761 $errorNotice.addClass( 'hidden' ); 760 762 $( '#replysubmit .spinner' ).addClass( 'is-active' ); 761 763 762 764 $('#replyrow input').not(':button').each(function() { … … 847 849 }, 848 850 849 851 error : function(r) { 850 var er = r.statusText; 852 var er = r.statusText, 853 $errorNotice = $( '#replysubmit .notice-error' ), 854 $error = $errorNotice.find( '.error' ); 851 855 852 856 $( '#replysubmit .spinner' ).removeClass( 'is-active' ); 853 857 … … 854 858 if ( r.responseText ) 855 859 er = r.responseText.replace( /<.[^<>]*?>/g, '' ); 856 860 857 if ( er ) 858 $('#replysubmit .error').html(er).show(); 859 861 if ( er ) { 862 $errorNotice.removeClass( 'hidden' ); 863 $error.html( er ); 864 } 860 865 }, 861 866 862 867 addcomment: function(post_id) { -
src/wp-admin/js/inline-edit-post.js
413 413 // Make ajax request. 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' ); 419 420 $( '.ac_results' ).hide(); … … 429 430 }); 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 } 439 442 }, -
src/wp-admin/js/inline-edit-tax.js
196 196 */ 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' ); 202 203 … … 225 226 }); 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 } 239 242 } -
src/wp-includes/taxonomy.php
424 424 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 430 430 global $wp_taxonomies; … … 745 745 */ 746 746 function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { 747 747 if ( empty( $term ) ) { 748 return new WP_Error( 'invalid_term', __( 'Empty Term ' ) );748 return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 749 749 } 750 750 751 751 if ( $taxonomy && ! taxonomy_exists( $taxonomy ) ) { … … 2122 2122 $data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args ); 2123 2123 2124 2124 if ( false === $wpdb->insert( $wpdb->terms, $data ) ) { 2125 return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database ' ), $wpdb->last_error );2125 return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database.' ), $wpdb->last_error ); 2126 2126 } 2127 2127 2128 2128 $term_id = (int) $wpdb->insert_id; … … 2346 2346 $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); 2347 2347 if ( $values ) 2348 2348 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)" ) ) 2349 return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database ' ), $wpdb->last_error );2349 return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error ); 2350 2350 } 2351 2351 2352 2352 wp_cache_delete( $object_id, $taxonomy . '_relationships' ); … … 2614 2614 } 2615 2615 2616 2616 if ( ! $term ) { 2617 return new WP_Error( 'invalid_term', __( 'Empty Term ' ) );2617 return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 2618 2618 } 2619 2619 2620 2620 $term = (array) $term->data; … … 2700 2700 $slug = wp_unique_term_slug($slug, (object) $args); 2701 2701 } else { 2702 2702 /* translators: 1: Taxonomy term slug */ 2703 return new WP_Error( 'duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug));2703 return new WP_Error( 'duplicate_term_slug', sprintf( __( 'The slug “%s” is already in use by another term.' ), $slug ) ); 2704 2704 } 2705 2705 } 2706 2706 … … 3915 3915 } 3916 3916 3917 3917 if ( !is_object($term) ) 3918 $term = new WP_Error( 'invalid_term', __('Empty Term'));3918 $term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); 3919 3919 3920 3920 if ( is_wp_error( $term ) ) 3921 3921 return $term; … … 4127 4127 */ 4128 4128 function is_object_in_term( $object_id, $taxonomy, $terms = null ) { 4129 4129 if ( !$object_id = (int) $object_id ) 4130 return new WP_Error( 'invalid_object', __( 'Invalid object ID ' ) );4130 return new WP_Error( 'invalid_object', __( 'Invalid object ID.' ) ); 4131 4131 4132 4132 $object_terms = get_object_term_cache( $object_id, $taxonomy ); 4133 4133 if ( false === $object_terms ) { -
tests/phpunit/tests/xmlrpc/wp/deleteTerm.php
51 51 $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) ); 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 57 57 function test_invalid_term() { -
tests/phpunit/tests/xmlrpc/wp/editTerm.php
68 68 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) ); 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 74 74 function test_empty_term_name() { … … 133 133 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) ); 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 139 139 function test_edit_all_fields() { -
tests/phpunit/tests/xmlrpc/wp/getTerm.php
53 53 $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) ); 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 59 59 function test_invalid_term() {