get_the_privacy_policy_link()
最后更新于:2021-11-27 02:41:27
get_the_privacy_policy_link( string$before=”, string$after=”)响应s the privacy policy link with formatting, when applicable.
参数
- $before
-
(string) (Optional) Display before privacy policy link.
Default value: ”
- $after
-
(string) (Optional) Display after privacy policy link.
Default value: ”
响应
(string) Markup for the link and surrounding elements. Empty string if it doesn’t exist.
源文件
文件: gc-includes/link-template.php
function get_the_privacy_policy_link( $before = '', $after = '' ) {
$link = '';
$privacy_policy_url = get_privacy_policy_url();
$policy_page_id = (int) get_option( 'gc_page_for_privacy_policy' );
$page_title = ( $policy_page_id ) ? get_the_title( $policy_page_id ) : '';
if ( $privacy_policy_url && $page_title ) {
$link = sprintf(
'<a class="privacy-policy-link" href="https://docs.gechiui.com/functions/get_the_privacy_policy_link/%s">%s</a>',
esc_url( $privacy_policy_url ),
esc_html( $page_title )
);
}
/**
* Filters the privacy policy link.
*
* @since 4.9.6
*
* @param string $link The privacy policy link. Empty string if it
* doesn't exist.
* @param string $privacy_policy_url The URL of the privacy policy. Empty string
* if it doesn't exist.
*/
$link = apply_filters( 'the_privacy_policy_link', $link, $privacy_policy_url );
if ( $link ) {
return $before . $link . $after;
}
return '';
}