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
This commit is contained in:
Andrew Ozz 2018-04-20 14:43:26 +00:00
parent 7e26130f12
commit c9aaa0ddb7
1 changed files with 3 additions and 3 deletions

View File

@ -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 '';
}