Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().

Props desrosj, birgire, ianbelanger, Ov3rfly.
Fixes #44192.
Built from https://develop.svn.wordpress.org/trunk@43506


git-svn-id: http://core.svn.wordpress.org/trunk@43335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-07-18 11:50:25 +00:00
parent 12b1b3e891
commit ac338b1666
2 changed files with 5 additions and 3 deletions

View File

@ -4327,12 +4327,14 @@ function the_privacy_policy_link( $before = '', $after = '' ) {
function get_the_privacy_policy_link( $before = '', $after = '' ) {
$link = '';
$privacy_policy_url = get_privacy_policy_url();
$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
$page_title = ( $policy_page_id ) ? get_the_title( $policy_page_id ) : '';
if ( $privacy_policy_url ) {
if ( $privacy_policy_url && $page_title ) {
$link = sprintf(
'<a class="privacy-policy-link" href="%s">%s</a>',
esc_url( $privacy_policy_url ),
__( 'Privacy Policy' )
esc_html( $page_title )
);
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43504';
$wp_version = '5.0-alpha-43506';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.