Ticket #35496: 35496.3.diff
File 35496.3.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
1737 1737 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 ) { 1743 1743 wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); … … 1752 1752 <?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) { ?> 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 1760 1762 $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 notice-alt 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 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="" /> 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 ) 657 .addClass( 'hidden' ) 658 .find( '.error' ).empty(); 657 659 $( '.spinner', replyrow ).removeClass( 'is-active' ); 658 660 659 661 this.cid = ''; … … 754 756 }, 755 757 756 758 send : function() { 757 var post = {}; 759 var post = {}, 760 $errorNotice = $( '#replysubmit .error-notice' ); 758 761 759 $ ('#replysubmit .error').hide();762 $errorNotice.addClass( 'hidden' ); 760 763 $( '#replysubmit .spinner' ).addClass( 'is-active' ); 761 764 762 765 $('#replyrow input').not(':button').each(function() { … … 847 850 }, 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' ); 853 858 … … 854 859 if ( r.responseText ) 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 862 868 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; … … 746 746 */ 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 752 752 if ( $taxonomy && ! taxonomy_exists( $taxonomy ) ) { … … 2123 2123 $data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args ); 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 2129 2129 $term_id = (int) $wpdb->insert_id; … … 2347 2347 $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); 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 2353 2353 wp_cache_delete( $object_id, $taxonomy . '_relationships' ); … … 2615 2615 } 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 2621 2621 $term = (array) $term->data; … … 2701 2701 $slug = wp_unique_term_slug($slug, (object) $args); 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 } 2707 2707 … … 3916 3916 } 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 ) ) 3922 3922 return $term; … … 4128 4128 */ 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 ); 4134 4134 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() {