mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Privacy: On Privacy Settings screen, check if any pages exist before displaying the page selector.
Props abdullahramzan, desrosj, melchoyce. Fixes #43940. Built from https://develop.svn.wordpress.org/trunk@43238 git-svn-id: http://core.svn.wordpress.org/trunk@43067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b26ab11343
commit
b7ff8e4f9f
@ -167,9 +167,20 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
$has_pages = (bool) get_posts( array(
|
||||
'post_type' => 'page',
|
||||
'posts_per_page' => 1,
|
||||
'post_status' => array(
|
||||
'publish',
|
||||
'draft',
|
||||
),
|
||||
) );
|
||||
|
||||
if ( $has_pages ) : ?>
|
||||
<form method="post" action="">
|
||||
<label for="page_for_privacy_policy">
|
||||
<?php _e( 'Either select an existing page:' ); ?>
|
||||
<?php _e( 'Select an existing page:' ); ?>
|
||||
</label>
|
||||
<input type="hidden" name="action" value="set-privacy-page" />
|
||||
<?php
|
||||
@ -188,11 +199,18 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
|
||||
?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="action" value="create-privacy-page" />
|
||||
<span>
|
||||
<?php _e( 'Or create a new page:' ); ?>
|
||||
<?php
|
||||
if ( $has_pages ) {
|
||||
_e( 'Or:' );
|
||||
} else {
|
||||
_e( 'There are no pages.' );
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
wp_nonce_field( 'create-privacy-page' );
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-43236';
|
||||
$wp_version = '5.0-alpha-43238';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user