diff --git a/wp-includes/class-walker-nav-menu.php b/wp-includes/class-walker-nav-menu.php index 2b06d54b44..3d9f442bb8 100644 --- a/wp-includes/class-walker-nav-menu.php +++ b/wp-includes/class-walker-nav-menu.php @@ -39,6 +39,23 @@ class Walker_Nav_Menu extends Walker { 'id' => 'db_id', ); + /** + * The URL to the privacy policy page. + * + * @since 6.8.0 + * @var string + */ + private $privacy_policy_url; + + /** + * Constructor. + * + * @since 6.8.0 + */ + public function __construct() { + $this->privacy_policy_url = get_privacy_policy_url(); + } + /** * Starts the list before the elements are added. * @@ -236,7 +253,7 @@ class Walker_Nav_Menu extends Walker { $atts['rel'] = ! empty( $menu_item->xfn ) ? $menu_item->xfn : ''; if ( ! empty( $menu_item->url ) ) { - if ( get_privacy_policy_url() === $menu_item->url ) { + if ( $this->privacy_policy_url === $menu_item->url ) { $atts['rel'] = empty( $atts['rel'] ) ? 'privacy-policy' : $atts['rel'] . ' privacy-policy'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 8f9a4de7af..9c1cd69092 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59673'; +$wp_version = '6.8-alpha-59674'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.