| 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 |
| | 4298 | * doesn't exist. |
| | 4299 | * @param int $file The ID of privacy policy page. |
| | 4300 | */ |
| | 4301 | return apply_filters( 'privacy_policy_url', $url, $policy_page_id ); |
| | 4302 | } |
| | 4303 | |
| | 4304 | /** |
| | 4305 | * Displays the privacy policy link with formatting, when applicable. |
| | 4306 | * |
| | 4307 | * @since 4.9.6 |
| | 4308 | * |
| | 4309 | * @param string $before Optional. Display before privacy policy link. Default empty. |
| | 4310 | * @param string $after Optional. Display after privacy policy link. Default empty. |
| | 4311 | */ |
| | 4312 | function the_privacy_policy_link( $before = '', $after = '' ) { |
| | 4313 | echo get_the_privacy_policy_link( $before, $after ); |
| | 4314 | } |
| | 4315 | |
| | 4316 | /** |
| | 4317 | * Returns the privacy policy link with formatting, when applicable. |
| | 4318 | * |
| | 4319 | * @since 4.9.6 |
| | 4320 | * |
| | 4321 | * @param string $before Optional. Display before privacy policy link. Default empty. |
| | 4322 | * @param string $after Optional. Display after privacy policy link. Default empty. |
| | 4323 | * |
| | 4324 | * @return string Markup for the link and surrounding elements. Empty string if it |
| | 4325 | * doesn't exist. |
| | 4326 | */ |
| | 4327 | function get_the_privacy_policy_link( $before = '', $after = '' ) { |
| | 4328 | $link = ''; |
| | 4329 | $privacy_policy_url = get_privacy_policy_url(); |
| | 4330 | |
| | 4331 | if ( $privacy_policy_url ) { |
| | 4332 | $link = sprintf( |
| | 4333 | '<a class="privacy-policy-link" href="%s">%s</a>', |
| | 4334 | esc_url( $privacy_policy_url ), |
| | 4335 | __( 'Privacy Policy' ) |
| | 4336 | ); |
| | 4337 | } |
| | 4338 | |
| | 4339 | /** |
| | 4340 | * Filters the privacy policy link. |
| | 4341 | * |
| | 4342 | * @since 4.9.6 |
| | 4343 | * |
| | 4344 | * @param string $link The privacy policy link. Empty string if it |
| | 4345 | * doesn't exist. |
| | 4346 | * @param string $privacy_policy_url The URL of the privacy policy. Empty string |
| | 4347 | * if it doesn't exist. |
| | 4348 | */ |
| | 4349 | $link = apply_filters( 'the_privacy_policy_link', $link, $privacy_policy_url ); |
| | 4350 | |
| | 4351 | return $before . $link . $after; |