diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index c4d06a610e..d12040cc7f 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -837,6 +837,7 @@ hr { } abbr.required, +span.required, .file-error, .widget-control-remove:hover, .row-actions .delete a:hover, diff --git a/src/wp-admin/css/deprecated-media.css b/src/wp-admin/css/deprecated-media.css index 9e8f3e3b27..5365a18e92 100644 --- a/src/wp-admin/css/deprecated-media.css +++ b/src/wp-admin/css/deprecated-media.css @@ -152,7 +152,8 @@ thead.media-item-info tr { border: 8px solid #fff; } -abbr.required { +abbr.required, +span.required { text-decoration: none; border: none; } @@ -364,9 +365,14 @@ h4.media-sub-title { } p.media-types { + margin: 0; padding: 1em; } +p.media-types-required-info { + padding-top: 0; +} + tr.not-image { display: none; } diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index d9dd1e67cd..2f7e585731 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -1464,8 +1464,9 @@ function get_media_item( $attachment_id, $args = null ) { $item .= " - - \n"; + \n + \n +

" . sprintf( __( 'Required fields are marked %s' ), '*' ) . "

\n"; $defaults = array( 'input' => 'text', @@ -1537,12 +1538,13 @@ function get_media_item( $attachment_id, $args = null ) { continue; } - $required = $field['required'] ? '*' : ''; - $aria_required = $field['required'] ? " aria-required='true' " : ''; + $required = $field['required'] ? '*' : ''; + $required_attr = $field['required'] ? ' required' : ''; + $aria_required = $field['required'] ? " aria-required='true'" : ''; $class = $id; $class .= $field['required'] ? ' form-required' : ''; - $item .= "\t\t\n\t\t\t\n\t\t\t"; + $item .= "\t\t\n\t\t\t\n\t\t\t"; if ( !empty( $field[ $field['input'] ] ) ) $item .= $field[ $field['input'] ]; elseif ( $field['input'] == 'textarea' ) { @@ -1551,9 +1553,9 @@ function get_media_item( $attachment_id, $args = null ) { $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); } // Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit(). - $item .= "'; + $item .= "'; } else { - $item .= ""; + $item .= ""; } if ( !empty( $field['helps'] ) ) $item .= "

" . join( "

\n

", array_unique( (array) $field['helps'] ) ) . '

'; @@ -1690,8 +1692,9 @@ function get_compat_media_markup( $attachment_id, $args = null ) { } $readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : ''; - $required = $field['required'] ? '*' : ''; - $aria_required = $field['required'] ? " aria-required='true' " : ''; + $required = $field['required'] ? '*' : ''; + $required_attr = $field['required'] ? ' required' : ''; + $aria_required = $field['required'] ? " aria-required='true'" : ''; $class = 'compat-field-' . $id; $class .= $field['required'] ? ' form-required' : ''; @@ -1706,9 +1709,9 @@ function get_compat_media_markup( $attachment_id, $args = null ) { // sanitize_post() skips the post_content when user_can_richedit. $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES ); } - $item .= "'; + $item .= "'; } else { - $item .= ""; + $item .= ""; } if ( !empty( $field['helps'] ) ) $item .= "

" . join( "

\n

", array_unique( (array) $field['helps'] ) ) . '

'; @@ -1732,8 +1735,12 @@ function get_compat_media_markup( $attachment_id, $args = null ) { if ( !empty( $form_fields['_final'] ) ) $item .= "\t\t{$form_fields['_final']}\n"; - if ( $item ) - $item = '' . $item . '
'; + + if ( $item ) { + $item = '

' . + sprintf( __( 'Required fields are marked %s' ), '*' ) . '

+ ' . $item . '
'; + } foreach ( $hidden_fields as $hidden_field => $value ) { $item .= '' . "\n"; @@ -2111,7 +2118,7 @@ var addExtImage = { t.width = t.height = ''; document.getElementById('go_button').style.color = '#bbb'; if ( ! document.forms[0].src.value ) - document.getElementById('status_img').innerHTML = '*'; + document.getElementById('status_img').innerHTML = ''; else document.getElementById('status_img').innerHTML = ''; }, @@ -2541,21 +2548,21 @@ function wp_media_insert_url_form( $default_view = 'image' ) { return '

   

+

' . sprintf( __( 'Required fields are marked %s' ), '*' ) . '

- + - +
- - * + +
- - * +

' . __('Link text, e.g. “Ransom Demands (PDF)”') . '