diff --git a/src/wp-admin/css/ie.css b/src/wp-admin/css/ie.css index 23b90eb733..e3dc91391e 100644 --- a/src/wp-admin/css/ie.css +++ b/src/wp-admin/css/ie.css @@ -285,7 +285,7 @@ table.fixed td { width: 29%; } -.inline-edit-row p.submit { +.inline-edit-row .submit { zoom: 100%; } diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index ca40082609..8fc1020316 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -150,19 +150,12 @@ margin: 0; padding: 5px 7px 10px; overflow: hidden; - text-align: center; } #replysubmit .button { margin-right: 5px; } -#replysubmit .error { - color: red; - line-height: 21px; - text-align: center; -} - #replyrow.inline-edit-row fieldset.comment-reply { font-size: inherit; line-height: inherit; @@ -957,16 +950,19 @@ tr.inline-edit-row td, line-height: 2.5; } -.inline-edit-row p.submit { +.inline-edit-row .submit { clear: both; padding: 0.5em; margin: 0.5em 0 0; } -.inline-edit-row span.error { - line-height: 22px; - margin: 0 15px; - padding: 3px 5px; +.inline-edit-row .notice-error { + margin-top: 1em; +} + +.inline-edit-row .notice-error .error { + margin: 0.5em 0; + padding: 2px; } /* Positioning */ diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 71d7429feb..5395a0beac 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -1737,7 +1737,7 @@ class WP_Posts_List_Table extends WP_List_Table { } ?> -

+

post_type, 'author' ) ) { ?> -
-

+ +
-

+

-
-

+ +
-

- - - - - - - -

+
+

+ + + + + + + +

+
+ +
@@ -892,7 +898,7 @@ function wp_import_upload_form( $action ) { * @param string|array|WP_Screen $screen Optional. The screen or screens on which to show the box * (such as a post type, 'link', or 'comment'). Accepts a single * screen ID, WP_Screen object, or array of screen IDs. Default - * is the current screen. If you have used add_menu_page() or + * is the current screen. If you have used add_menu_page() or * add_submenu_page() to create a new screen (and hence screen_id), * make sure your menu slug conforms to the limits of sanitize_key() * otherwise the 'screen' menu may not correctly render on your page. diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js index 9e0fc09602..b9a9f2cf85 100644 --- a/src/wp-admin/js/edit-comments.js +++ b/src/wp-admin/js/edit-comments.js @@ -653,7 +653,9 @@ commentReply = { $('#com-reply').append( replyrow ); $('#replycontent').css('height', '').val(''); $('#edithead input').val(''); - $('.error', replyrow).empty().hide(); + $( '.notice-error', replyrow ) + .addClass( 'hidden' ) + .find( '.error' ).empty(); $( '.spinner', replyrow ).removeClass( 'is-active' ); this.cid = ''; @@ -754,9 +756,10 @@ commentReply = { }, send : function() { - var post = {}; + var post = {}, + $errorNotice = $( '#replysubmit .error-notice' ); - $('#replysubmit .error').hide(); + $errorNotice.addClass( 'hidden' ); $( '#replysubmit .spinner' ).addClass( 'is-active' ); $('#replyrow input').not(':button').each(function() { @@ -847,16 +850,19 @@ commentReply = { }, error : function(r) { - var er = r.statusText; + var er = r.statusText, + $errorNotice = $( '#replysubmit .notice-error' ), + $error = $errorNotice.find( '.error' ); $( '#replysubmit .spinner' ).removeClass( 'is-active' ); if ( r.responseText ) er = r.responseText.replace( /<.[^<>]*?>/g, '' ); - if ( er ) - $('#replysubmit .error').html(er).show(); - + if ( er ) { + $errorNotice.removeClass( 'hidden' ); + $error.html( er ); + } }, addcomment: function(post_id) { diff --git a/src/wp-admin/js/inline-edit-post.js b/src/wp-admin/js/inline-edit-post.js index b8771bf2b0..0b3d6a8817 100644 --- a/src/wp-admin/js/inline-edit-post.js +++ b/src/wp-admin/js/inline-edit-post.js @@ -413,7 +413,8 @@ var inlineEditPost; // Make ajax request. $.post( ajaxurl, params, function(r) { - var $errorSpan = $( '#edit-' + id + ' .inline-edit-save .error' ); + var $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ), + $error = $errorNotice.find( '.error' ); $( 'table.widefat .spinner' ).removeClass( 'is-active' ); $( '.ac_results' ).hide(); @@ -429,11 +430,13 @@ var inlineEditPost; }); } else { r = r.replace( /<.[^<>]*?>/g, '' ); - $errorSpan.html( r ).show(); - wp.a11y.speak( $errorSpan.text() ); + $errorNotice.removeClass( 'hidden' ); + $error.html( r ); + wp.a11y.speak( $error.text() ); } } else { - $errorSpan.html( inlineEditL10n.error ).show(); + $errorNotice.removeClass( 'hidden' ); + $error.html( inlineEditL10n.error ); wp.a11y.speak( inlineEditL10n.error ); } }, diff --git a/src/wp-admin/js/inline-edit-tax.js b/src/wp-admin/js/inline-edit-tax.js index daad73fd13..797001780d 100644 --- a/src/wp-admin/js/inline-edit-tax.js +++ b/src/wp-admin/js/inline-edit-tax.js @@ -196,7 +196,8 @@ inlineEditTax = { */ function(r) { var row, new_id, option_value, - $errorSpan = $( '#edit-' + id + ' .inline-edit-save .error' ); + $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ), + $error = $errorNotice.find( '.error' ); $( 'table.widefat .spinner' ).removeClass( 'is-active' ); @@ -225,15 +226,17 @@ inlineEditTax = { }); } else { - $errorSpan.html( r ).show(); + $errorNotice.removeClass( 'hidden' ); + $error.html( r ); /* * Some error strings may contain HTML entities (e.g. `“`), let's use * the HTML element's text. */ - wp.a11y.speak( $errorSpan.text() ); + wp.a11y.speak( $error.text() ); } } else { - $errorSpan.html( inlineEditL10n.error ).show(); + $errorNotice.removeClass( 'hidden' ); + $error.html( inlineEditL10n.error ); wp.a11y.speak( inlineEditL10n.error ); } } diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index a6151317eb..3e6f6fbb52 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -424,7 +424,7 @@ function unregister_taxonomy( $taxonomy ) { // Do not allow unregistering internal taxonomies. if ( $taxonomy_object->_builtin ) { - return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed' ) ); + return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed.' ) ); } global $wp_taxonomies; @@ -746,7 +746,7 @@ function get_tax_sql( $tax_query, $primary_table, $primary_id_column ) { */ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) { if ( empty( $term ) ) { - return new WP_Error( 'invalid_term', __( 'Empty Term' ) ); + return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); } if ( $taxonomy && ! taxonomy_exists( $taxonomy ) ) { @@ -2123,7 +2123,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { $data = apply_filters( 'wp_insert_term_data', $data, $taxonomy, $args ); if ( false === $wpdb->insert( $wpdb->terms, $data ) ) { - return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database' ), $wpdb->last_error ); + return new WP_Error( 'db_insert_error', __( 'Could not insert term into the database.' ), $wpdb->last_error ); } $term_id = (int) $wpdb->insert_id; @@ -2347,7 +2347,7 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order); if ( $values ) 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)" ) ) - return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database' ), $wpdb->last_error ); + return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error ); } wp_cache_delete( $object_id, $taxonomy . '_relationships' ); @@ -2615,7 +2615,7 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) { } if ( ! $term ) { - return new WP_Error( 'invalid_term', __( 'Empty Term' ) ); + return new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); } $term = (array) $term->data; @@ -2701,7 +2701,7 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) { $slug = wp_unique_term_slug($slug, (object) $args); } else { /* translators: 1: Taxonomy term slug */ - return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug)); + return new WP_Error( 'duplicate_term_slug', sprintf( __( 'The slug “%s” is already in use by another term.' ), $slug ) ); } } @@ -3916,7 +3916,7 @@ function get_term_link( $term, $taxonomy = '' ) { } if ( !is_object($term) ) - $term = new WP_Error('invalid_term', __('Empty Term')); + $term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) ); if ( is_wp_error( $term ) ) return $term; @@ -4128,7 +4128,7 @@ function get_post_taxonomies( $post = 0 ) { */ function is_object_in_term( $object_id, $taxonomy, $terms = null ) { if ( !$object_id = (int) $object_id ) - return new WP_Error( 'invalid_object', __( 'Invalid object ID' ) ); + return new WP_Error( 'invalid_object', __( 'Invalid object ID.' ) ); $object_terms = get_object_term_cache( $object_id, $taxonomy ); if ( false === $object_terms ) { diff --git a/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php b/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php index 94e25c9c3d..20ee7c5290 100644 --- a/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php @@ -51,7 +51,7 @@ class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) ); $this->assertIXRError( $result ); $this->assertEquals( 500, $result->code ); - $this->assertEquals( __('Empty Term'), $result->message ); + $this->assertEquals( __('Empty Term.'), $result->message ); } function test_invalid_term() { diff --git a/tests/phpunit/tests/xmlrpc/wp/editTerm.php b/tests/phpunit/tests/xmlrpc/wp/editTerm.php index b5a132388a..b799cebefc 100644 --- a/tests/phpunit/tests/xmlrpc/wp/editTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/editTerm.php @@ -68,7 +68,7 @@ class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) ); $this->assertIXRError( $result ); $this->assertEquals( 500, $result->code ); - $this->assertEquals( __('Empty Term'), $result->message ); + $this->assertEquals( __('Empty Term.'), $result->message ); } function test_empty_term_name() { @@ -133,7 +133,7 @@ class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, array( 'taxonomy' => 'category', 'slug' => $parent_term->slug ) ) ); $this->assertIXRError( $result ); $this->assertEquals( 500, $result->code ); - $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term'), $parent_term->slug ) ), $result->message ); + $this->assertEquals( htmlspecialchars( sprintf( __('The slug “%s” is already in use by another term.'), $parent_term->slug ) ), $result->message ); } function test_edit_all_fields() { diff --git a/tests/phpunit/tests/xmlrpc/wp/getTerm.php b/tests/phpunit/tests/xmlrpc/wp/getTerm.php index df4f95053c..e32926dd1a 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/getTerm.php @@ -53,7 +53,7 @@ class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) ); $this->assertIXRError( $result ); $this->assertEquals( 500, $result->code ); - $this->assertEquals( __('Empty Term'), $result->message ); + $this->assertEquals( __('Empty Term.'), $result->message ); } function test_invalid_term() {