Privacy: fix `get_privacy_policy_url()` to only return the URL when the page is published.

See #43435.
Built from https://develop.svn.wordpress.org/trunk@42995


git-svn-id: http://core.svn.wordpress.org/trunk@42824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2018-04-20 14:44:20 +00:00
parent 81668f8312
commit cf0d00c602
2 changed files with 4 additions and 4 deletions

View File

@ -4284,9 +4284,9 @@ function get_parent_theme_file_path( $file = '' ) {
function get_privacy_policy_url() { function get_privacy_policy_url() {
$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
if ( empty( $policy_page_id ) ) { if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) {
return '';
}
return get_permalink( $policy_page_id ); return get_permalink( $policy_page_id );
} }
return '';
}

View File

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