Export: add missing labels and improvement accessibility of the Export screen.

Props afercia.
Fixes #33046.

Built from https://develop.svn.wordpress.org/trunk@35316


git-svn-id: http://core.svn.wordpress.org/trunk@35282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-10-21 03:57:24 +00:00
parent 85d21feca6
commit 47879dc83a
8 changed files with 100 additions and 38 deletions

View File

@ -753,6 +753,18 @@ table.form-table td .updated p {
line-height: 24px; line-height: 24px;
} }
.label-responsive {
vertical-align: middle;
}
#export-filters p {
margin: 0 0 1em;
}
#export-filters p.submit {
margin: 7px 0 5px;
}
/* Card styles */ /* Card styles */
.card { .card {
@ -1110,12 +1122,21 @@ table.form-table td .updated p {
} }
.form-table th, .form-table th,
.form-table td { .form-table td,
.label-responsive {
display: block; display: block;
width: auto; width: auto;
vertical-align: middle; vertical-align: middle;
} }
.label-responsive {
margin: 0.5em 0;
}
.export-filters li {
margin-bottom: 0;
}
.form-table .color-palette td { .form-table .color-palette td {
display: table-cell; display: table-cell;
width: 15px; width: 15px;

View File

@ -753,6 +753,18 @@ table.form-table td .updated p {
line-height: 24px; line-height: 24px;
} }
.label-responsive {
vertical-align: middle;
}
#export-filters p {
margin: 0 0 1em;
}
#export-filters p.submit {
margin: 7px 0 5px;
}
/* Card styles */ /* Card styles */
.card { .card {
@ -1110,12 +1122,21 @@ table.form-table td .updated p {
} }
.form-table th, .form-table th,
.form-table td { .form-table td,
.label-responsive {
display: block; display: block;
width: auto; width: auto;
vertical-align: middle; vertical-align: middle;
} }
.label-responsive {
margin: 0.5em 0;
}
.export-filters li {
margin-bottom: 0;
}
.form-table .color-palette td { .form-table .color-palette td {
display: table-cell; display: table-cell;
width: 15px; width: 15px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -160,37 +160,45 @@ function export_date_options( $post_type = 'post' ) {
<h2><?php _e( 'Choose what to export' ); ?></h2> <h2><?php _e( 'Choose what to export' ); ?></h2>
<form method="get" id="export-filters"> <form method="get" id="export-filters">
<fieldset>
<legend class="screen-reader-text"><?php _e( 'Content to export' ); ?></legend>
<input type="hidden" name="download" value="true" /> <input type="hidden" name="download" value="true" />
<p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label></p> <p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p>
<p class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p> <p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></p>
<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p> <p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
<ul id="post-filters" class="export-filters"> <ul id="post-filters" class="export-filters">
<li> <li>
<label><?php _e( 'Categories:' ); ?></label> <label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span>
<?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?> <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
</label>
</li> </li>
<li> <li>
<label><?php _e( 'Authors:' ); ?></label> <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
<?php <?php
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) );
?> ?>
</label>
</li> </li>
<li> <li>
<label><?php _e( 'Date range:' ); ?></label> <fieldset>
<select name="post_start_date"> <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
<option value="0"><?php _e( 'Start Date' ); ?></option> <label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
<select name="post_start_date" id="post-start-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options(); ?> <?php export_date_options(); ?>
</select> </select>
<select name="post_end_date"> <label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
<option value="0"><?php _e( 'End Date' ); ?></option> <select name="post_end_date" id="post-end-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options(); ?> <?php export_date_options(); ?>
</select> </select>
</fieldset>
</li> </li>
<li> <li>
<label><?php _e( 'Status:' ); ?></label> <label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
<select name="post_status"> <select name="post_status" id="post-status">
<option value="0"><?php _e( 'All' ); ?></option> <option value="0"><?php _e( 'All' ); ?></option>
<?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' ); <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
foreach ( $post_stati as $status ) : ?> foreach ( $post_stati as $status ) : ?>
@ -203,26 +211,31 @@ function export_date_options( $post_type = 'post' ) {
<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p> <p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
<ul id="page-filters" class="export-filters"> <ul id="page-filters" class="export-filters">
<li> <li>
<label><?php _e( 'Authors:' ); ?></label> <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
<?php <?php
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) ); wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) );
?> ?>
</label>
</li> </li>
<li> <li>
<label><?php _e( 'Date range:' ); ?></label> <fieldset>
<select name="page_start_date"> <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
<option value="0"><?php _e( 'Start Date' ); ?></option> <label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
<select name="page_start_date" id="page-start-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options( 'page' ); ?> <?php export_date_options( 'page' ); ?>
</select> </select>
<select name="page_end_date"> <label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
<option value="0"><?php _e( 'End Date' ); ?></option> <select name="page_end_date" id="page-end-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options( 'page' ); ?> <?php export_date_options( 'page' ); ?>
</select> </select>
</fieldset>
</li> </li>
<li> <li>
<label><?php _e( 'Status:' ); ?></label> <label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
<select name="page_status"> <select name="page_status" id="page-status">
<option value="0"><?php _e( 'All' ); ?></option> <option value="0"><?php _e( 'All' ); ?></option>
<?php foreach ( $post_stati as $status ) : ?> <?php foreach ( $post_stati as $status ) : ?>
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
@ -234,23 +247,30 @@ function export_date_options( $post_type = 'post' ) {
<?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>
<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
<?php endforeach; ?> <?php endforeach; ?>
<p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p> <p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p>
<ul id="attachment-filters" class="export-filters"> <ul id="attachment-filters" class="export-filters">
<li> <li>
<label><?php _e( 'Date range:' ); ?></label> <fieldset>
<select name="attachment_start_date"> <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
<option value="0"><?php _e( 'Start Date' ); ?></option> <label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
<select name="attachment_start_date" id="attachment-start-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options( 'attachment' ); ?> <?php export_date_options( 'attachment' ); ?>
</select> </select>
<select name="attachment_end_date"> <label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
<option value="0"><?php _e( 'End Date' ); ?></option> <select name="attachment_end_date" id="attachment-end-date">
<option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php export_date_options( 'attachment' ); ?> <?php export_date_options( 'attachment' ); ?>
</select> </select>
</fieldset>
</li> </li>
</ul> </ul>
</fieldset>
<?php <?php
/** /**
* Fires after the export filters form. * Fires at the end of the export filters form.
* *
* @since 3.5.0 * @since 3.5.0
*/ */

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-35315'; $wp_version = '4.4-alpha-35316';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.