From 53ae77416831acf85d9d6e5a0f3378bf4131d7ca Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Jul 2018 11:52:25 +0000 Subject: [PATCH] Privacy: Use the actual Privacy Policy page title in `get_the_privacy_policy_link()`. Props desrosj, birgire, ianbelanger, Ov3rfly. Merges [43506] to the 4.9 branch. Fixes #44192. Built from https://develop.svn.wordpress.org/branches/4.9@43507 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43336 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index b55ebcb189..00b572c5c5 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -4158,12 +4158,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( '%s', esc_url( $privacy_policy_url ), - __( 'Privacy Policy' ) + esc_html( $page_title ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index ab8e10b3a4..e1c2538fd6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.8-beta1-43505'; +$wp_version = '4.9.8-beta1-43507'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.