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:
parent
7e26130f12
commit
c9aaa0ddb7
@ -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 '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user