Make WordPress Core

Ticket #43620: 43620-url-filter.diff

File 43620-url-filter.diff, 989 bytes (added by iandunn, 6 years ago)

Add privacy_policy_url filter

  • wp-includes/link-template.php

    diff --git wp-includes/link-template.php wp-includes/link-template.php
    index 9db1065c77..d66afc6068 100644
    function get_parent_theme_file_path( $file = '' ) { 
    42824282 * @return string The URL to the privacy policy page. Empty string if it doesn't exist.
    42834283 */
    42844284function get_privacy_policy_url() {
     4285        $url            = '';
    42854286        $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
    42864287
    42874288        if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) {
    4288                 return get_permalink( $policy_page_id );
     4289                $url = get_permalink( $policy_page_id );
    42894290        }
    42904291
    4291         return '';
     4292        /**
     4293         * Filters the URL of the privacy policy page.
     4294         *
     4295         * @since 4.9.6
     4296         *
     4297         * @param string $url  The URL to the privacy policy page. Empty string if it doesn't exist.
     4298         * @param int    $file The ID of privacy policy page.
     4299         */
     4300        return apply_filters( 'privacy_policy_url', $url, $policy_page_id );
    42924301}