Make WordPress Core


Ignore:
Timestamp:
04/20/2018 02:43:26 PM (6 years ago)
Author:
azaozz
Message:

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

See #43435.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r42980 r42995  
    42854285    $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
    42864286
    4287     if ( empty( $policy_page_id ) ) {
    4288         return '';
    4289     }
    4290 
    4291     return get_permalink( $policy_page_id );
    4292 }
     4287    if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) {
     4288        return get_permalink( $policy_page_id );
     4289    }
     4290
     4291    return '';
     4292}
Note: See TracChangeset for help on using the changeset viewer.