From c9aaa0ddb7cb9a7ad4f40bb79e04f9d7a3a8b84c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 20 Apr 2018 14:43:26 +0000 Subject: [PATCH] Privacy: fix `get_privacy_policy_url()` to only return the URL when the page is published. See #43435. git-svn-id: https://develop.svn.wordpress.org/trunk@42995 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index e1d12f089f..9db1065c77 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -4284,9 +4284,9 @@ function get_parent_theme_file_path( $file = '' ) { function get_privacy_policy_url() { $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); - if ( empty( $policy_page_id ) ) { - return ''; + if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) { + return get_permalink( $policy_page_id ); } - return get_permalink( $policy_page_id ); + return ''; }