Weston Ruter 396f6fbe43 Menus: Improve performance by calling get_privacy_policy_url() once per Walker_Nav_Menu instance rather than for every nav menu item.
The `start_el()` method in `Walker_Nav_Menu` was calling `get_privacy_policy_url()` for every menu item when building menus. This resulted in redundant queries, particularly for menus with many items. This obtains the `get_privacy_policy_url()` value in the constructor for reuse in the `start_el()` method to improve performance.

Redundant code to construct the privacy policy page is also refactored into the `set_up()` method during tests.

Props arzola, swissspidy, westonruter, mukesh27.
Fixes #62818.


git-svn-id: https://develop.svn.wordpress.org/trunk@59674 602fd350-edb4-49c9-b593-d223f7449a82
2025-01-21 21:24:59 +00:00
..