Accessibility improvements for the Privacy Tools screen.

Propr afercia.
See #43435.
Built from https://develop.svn.wordpress.org/trunk@42823


git-svn-id: http://core.svn.wordpress.org/trunk@42653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2018-03-10 14:01:31 +00:00
parent f700ac6075
commit ba7b8cd8a0
2 changed files with 60 additions and 59 deletions

View File

@ -60,7 +60,7 @@ if ( ! empty( $action ) ) {
} }
} }
// If a privacy policy page ID is available, make sure the page actually exists. If not, display a warning // If a privacy policy page ID is available, make sure the page actually exists. If not, display an error.
$privacy_policy_page_exists = false; $privacy_policy_page_exists = false;
$privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
@ -71,7 +71,7 @@ if ( ! empty( $privacy_policy_page_id ) ) {
'page_for_privacy_policy', 'page_for_privacy_policy',
'page_for_privacy_policy', 'page_for_privacy_policy',
__( 'The currently selected privacy policy page does not exist. Please create or select new page.' ), __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ),
'warning' 'error'
); );
} else { } else {
if ( 'trash' === $privacy_policy_page->post_status ) { if ( 'trash' === $privacy_policy_page->post_status ) {
@ -90,8 +90,6 @@ if ( ! empty( $privacy_policy_page_id ) ) {
} }
} }
$title = __( 'Privacy Tools' );
get_current_screen()->add_help_tab( array( get_current_screen()->add_help_tab( array(
'id' => 'privacy', 'id' => 'privacy',
'title' => __( 'Privacy' ), 'title' => __( 'Privacy' ),
@ -107,71 +105,70 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
?> ?>
<div class="wrap"> <div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1> <h1><?php _e( 'Privacy Tools' ); ?></h1>
<?php settings_errors(); ?> <?php settings_errors(); ?>
<h2 class="title"><?php _e( 'Privacy policy page' ); ?></h2> <h2><?php _e( 'Privacy policy page' ); ?></h2>
<table class="form-table">
<?php
if ( $privacy_policy_page_exists ) { <?php
$edit_href = add_query_arg( if ( $privacy_policy_page_exists ) {
array( $edit_href = add_query_arg(
'post' => $privacy_policy_page_id, array(
'action' => 'edit', 'post' => $privacy_policy_page_id,
), 'action' => 'edit',
admin_url( 'post.php' ) ),
); admin_url( 'post.php' )
$view_href = get_permalink( $privacy_policy_page_id ); );
$view_href = get_permalink( $privacy_policy_page_id );
?>
<tr>
<th colspan="2">
<?php
printf(
__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
$edit_href,
$view_href
);
?>
</th>
</tr>
<?php
}
?> ?>
<p><strong>
<?php
printf(
__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ),
$edit_href,
$view_href
);
?>
</strong></p>
<?php
}
?>
<table class="form-table">
<tr> <tr>
<th scope="row"> <th scope="row">
<?php <label for="page_for_privacy_policy">
<?php
if ( $privacy_policy_page_exists ) { if ( $privacy_policy_page_exists ) {
_e( 'Select another page for your privacy policy' ); _e( 'Select another page for your privacy policy' );
} else { } else {
_e( 'Select an existing privacy policy page' ); _e( 'Select an existing privacy policy page' );
} }
?> ?>
</label>
</th> </th>
<td id="front-static-pages"> <td id="front-static-pages">
<form method="post" action=""> <form method="post" action="">
<?php wp_nonce_field( 'set-privacy-page' ); ?>
<input type="hidden" name="action" value="set-privacy-page" /> <input type="hidden" name="action" value="set-privacy-page" />
<fieldset> <?php
<legend class="screen-reader-text"><span><?php _e( 'Select your privacy policy page.' ); ?></span></legend>
<label for="page_for_privacy_policy"> wp_dropdown_pages(
<?php wp_dropdown_pages( array(
array( 'name' => 'page_for_privacy_policy',
'name' => 'page_for_privacy_policy', 'show_option_none' => __( '&mdash; Select &mdash;' ),
'show_option_none' => __( '&mdash; Select &mdash;' ), 'option_none_value' => '0',
'option_none_value' => '0', 'selected' => $privacy_policy_page_id,
'selected' => $privacy_policy_page_id, 'post_status' => array( 'draft', 'publish' ),
'post_status' => array( 'draft', 'publish' ), )
) );
);
?> wp_nonce_field( 'set-privacy-page' );
</label> submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) );
</fieldset>
<?php submit_button( __( 'Set Page' ) ); ?> ?>
</form> </form>
</td> </td>
</tr> </tr>
@ -184,8 +181,12 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<td> <td>
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="action" value="create-privacy-page" /> <input type="hidden" name="action" value="create-privacy-page" />
<?php wp_nonce_field( 'create-privacy-page' ); ?> <?php
<?php submit_button( __( 'Create Page' ) ); ?>
wp_nonce_field( 'create-privacy-page' );
submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) );
?>
</form> </form>
</td> </td>
</tr> </tr>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.0-alpha-42822'; $wp_version = '5.0-alpha-42823';
/** /**
* 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.