get_privacy_policy_url

The timeline below displays how wordpress function get_privacy_policy_url has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: .10

/**
 * Retrieves the URL to the privacy policy page.
 *
 * @since 4.9.6
 *
 * @return string The URL to the privacy policy page. Empty string if it doesn't exist.
 */
function get_privacy_policy_url()
{
    $url = '';
    $policy_page_id = (int) get_option('wp_page_for_privacy_policy');
    if (!empty($policy_page_id) && get_post_status($policy_page_id) === 'publish') {
        $url = (string) get_permalink($policy_page_id);
    }
    /**
     * Filters the URL of the privacy policy page.
     *
     * @since 4.9.6
     *
     * @param string $url            The URL to the privacy policy page. Empty string
     *                               if it doesn't exist.
     * @param int    $policy_page_id The ID of privacy policy page.
     */
    return apply_filters('privacy_policy_url', $url, $policy_page_id);
}