Filter hook 'privacy_policy_url'

in WP Core File wp-includes/link-template.php at line 4736

View Source

privacy_policy_url

Filter Hook
Description
Filters the URL of the privacy policy page.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 4736

Hook Parameters

Type Name Description
string $url The URL to the privacy policy page. Empty string if it doesn't exist.
int $policy_page_id The ID of privacy policy page.

Usage Examples

Basic Usage
<?php
// Hook into privacy_policy_url
add_filter('privacy_policy_url', 'my_custom_filter', 10, 2);

function my_custom_filter($url, $policy_page_id) {
    // Your custom filtering logic here
    return $url;
}

Source Code Context

wp-includes/link-template.php:4736 - How this hook is used in WordPress core
<?php
4731  	 *
4732  	 * @param string $url            The URL to the privacy policy page. Empty string
4733  	 *                               if it doesn't exist.
4734  	 * @param int    $policy_page_id The ID of privacy policy page.
4735  	 */
4736  	return apply_filters( 'privacy_policy_url', $url, $policy_page_id );
4737  }
4738  
4739  /**
4740   * Displays the privacy policy link with formatting, when applicable.
4741   *

PHP Documentation

<?php
/**
	 * 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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.