Ticket #43620: 43620.policy_url.policy_link.diff
File 43620.policy_url.policy_link.diff, 1.6 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 */ 4311 function get_privacy_policy_link( $before = '', $after = '' ) { 4312 4313 $link = '<a class="privacy-policy-link" href="' . esc_url( get_privacy_policy_url() ) . '">' . __( 'Privacy Policy' ) . '</a>'; 4314 4315 /** 4316 * Filters the privacy policy link. 4317 * 4318 * @since 4.9.6 4319 * 4320 * @param string $location The edit link. 4321 */ 4322 echo $before . apply_filters( 'get_privacy_policy_link', $link ) . $after; 4323 }