Ticket #43620: 43620.policy_url.policy_link_2.diff
File 43620.policy_url.policy_link_2.diff, 1.8 KB (added by , 6 years ago) |
---|
-
wp-includes/link-template.php
4282 4282 * @return string The URL to the privacy policy page. Empty string if it doesn't exist. 4283 4283 */ 4284 4284 function get_privacy_policy_url() { 4285 $url = ''; 4285 4286 $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); 4286 4287 4287 4288 if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) { 4288 returnget_permalink( $policy_page_id );4289 $url = get_permalink( $policy_page_id ); 4289 4290 } 4290 4291 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 ); 4292 4301 } 4302 4303 /** 4304 * Displays the privacy policy link with formatting. 4305 * 4306 * @since 4.9.6 4307 * 4308 * @param string $before Optional. Display before privacy policy link. Default empty. 4309 * @param string $after Optional. Display after privacy policy link. Default empty. 4310 * @param bool $echo Optional. Whether or not to echo the return. Default true. 4311 * 4312 * @return string|void HTML content. 4313 */ 4314 function the_privacy_policy_link( $before = '', $after = '', $echo = true ) { 4315 4316 $link = '<a class="privacy-policy-link" href="' . esc_url( get_privacy_policy_url() ) . '">' . __( 'Privacy Policy' ) . '</a>'; 4317 4318 /** 4319 * Filters the privacy policy link. 4320 * 4321 * @since 4.9.6 4322 * 4323 * @param string $link The edit link. 4324 */ 4325 $link = $before . apply_filters( 'get_privacy_policy_link', $link ) . $after; 4326 4327 if ( $echo ) { 4328 echo $link; 4329 } else { 4330 return $link; 4331 } 4332 }