WordPress.org

Make WordPress Core

Changeset 43102


Ignore:
Timestamp:
05/02/2018 02:59:49 AM (12 months ago)
Author:
SergeyBiryukov
Message:

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

Props azaozz.
Merges [42995] to the 4.9 branch.
See #43435.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/link-template.php

    r43101 r43102  
    41164116    $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
    41174117
    4118     if ( empty( $policy_page_id ) ) {
    4119         return '';
    4120     }
    4121 
    4122     return get_permalink( $policy_page_id );
    4123 }
     4118    if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) {
     4119        return get_permalink( $policy_page_id );
     4120    }
     4121
     4122    return '';
     4123}
Note: See TracChangeset for help on using the changeset viewer.