From 1600aef2abce20715a7e992da7cc03d9c20a2884 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 10 May 2018 21:41:26 +0000 Subject: [PATCH] Privacy: On Privacy Settings screen, check if any pages exist before displaying the page selector. Props abdullahramzan, desrosj, melchoyce. Merges [43238] to the 4.9 branch. Fixes #43940. Built from https://develop.svn.wordpress.org/branches/4.9@43239 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43068 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/privacy.php | 58 +++++++++++++++++++++++++++-------------- wp-includes/version.php | 2 +- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/wp-admin/privacy.php b/wp-admin/privacy.php index 7e8801235c..e8d024a21f 100644 --- a/wp-admin/privacy.php +++ b/wp-admin/privacy.php @@ -167,32 +167,50 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?> -
- - - 'page_for_privacy_policy', - 'show_option_none' => __( '— Select —' ), - 'option_none_value' => '0', - 'selected' => $privacy_policy_page_id, - 'post_status' => array( 'draft', 'publish' ), - ) - ); + 'page', + 'posts_per_page' => 1, + 'post_status' => array( + 'publish', + 'draft', + ), + ) ); - wp_nonce_field( 'set-privacy-page' ); + if ( $has_pages ) : ?> + + + + 'page_for_privacy_policy', + 'show_option_none' => __( '— Select —' ), + 'option_none_value' => '0', + 'selected' => $privacy_policy_page_id, + 'post_status' => array( 'draft', 'publish' ), + ) + ); - submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); - ?> -
+ wp_nonce_field( 'set-privacy-page' ); + + submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); + ?> + +
- +