diff --git a/src/wp-includes/class-wp-customize-nav-menus.php b/src/wp-includes/class-wp-customize-nav-menus.php
index 3348aab..49edb15 100644
|
a
|
b
|
final class WP_Customize_Nav_Menus { |
| 139 | 139 | */ |
| 140 | 140 | public function load_available_items_query( $type = 'post_type', $object = 'page', $page = 0 ) { |
| 141 | 141 | $items = array(); |
| | 142 | $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); |
| 142 | 143 | |
| 143 | 144 | if ( 'post_type' === $type ) { |
| 144 | 145 | $post_type = get_post_type_object( $object ); |
| … |
… |
final class WP_Customize_Nav_Menus { |
| 156 | 157 | 'object' => '', |
| 157 | 158 | 'url' => home_url(), |
| 158 | 159 | ); |
| | 160 | |
| | 161 | // Add "Privacy Policy" link. Treat as a page, but switch to custom on add. |
| | 162 | if ( ! empty( $privacy_policy_page_id ) ) { |
| | 163 | $items[] = array( |
| | 164 | 'id' => 'privacy-policy', |
| | 165 | 'title' => _x( 'Privacy Policy', 'nav menu privacy policy page label' ), |
| | 166 | 'type' => 'custom', |
| | 167 | 'type_label' => _x( 'Privacy Policy', 'nav menu privacy policy page label' ), |
| | 168 | 'object' => '', |
| | 169 | 'url' => get_permalink( $privacy_policy_page_id ), |
| | 170 | ); |
| | 171 | } |
| 159 | 172 | } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) { |
| 160 | 173 | // Add a post type archive link. |
| 161 | 174 | $items[] = array( |
| … |
… |
final class WP_Customize_Nav_Menus { |
| 188 | 201 | 'orderby' => 'date', |
| 189 | 202 | 'order' => 'DESC', |
| 190 | 203 | 'post_type' => $object, |
| | 204 | 'exclude' => array( $privacy_policy_page_id ), |
| 191 | 205 | ) |
| 192 | 206 | ) |
| 193 | 207 | ); |
| … |
… |
final class WP_Customize_Nav_Menus { |
| 305 | 319 | public function search_available_items_query( $args = array() ) { |
| 306 | 320 | $items = array(); |
| 307 | 321 | |
| | 322 | $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); |
| 308 | 323 | $post_type_objects = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' ); |
| 309 | 324 | $query = array( |
| 310 | 325 | 'post_type' => array_keys( $post_type_objects ), |
| … |
… |
final class WP_Customize_Nav_Menus { |
| 313 | 328 | 'update_post_meta_cache' => false, |
| 314 | 329 | 'post_status' => 'publish', |
| 315 | 330 | 'posts_per_page' => 20, |
| | 331 | 'post__not_in' => array( $privacy_policy_page_id ), |
| 316 | 332 | ); |
| 317 | 333 | |
| 318 | 334 | $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1; |
| … |
… |
final class WP_Customize_Nav_Menus { |
| 402 | 418 | 'url' => home_url(), |
| 403 | 419 | ); |
| 404 | 420 | } |
| | 421 | |
| | 422 | $title = _x( 'Privacy Policy', 'nav menu privacy policy page label' ); |
| | 423 | $matches = function_exists( 'mb_stripos' ) ? false !== mb_stripos( $title, $args['s'] ) : false !== stripos( $title, $args['s'] ); |
| | 424 | if ( $matches ) { |
| | 425 | $items[] = array( |
| | 426 | 'id' => 'privacy-policy', |
| | 427 | 'title' => $title, |
| | 428 | 'type' => 'custom', |
| | 429 | 'type_label' => $title, |
| | 430 | 'object' => '', |
| | 431 | 'url' => get_permalink( $privacy_policy_page_id ), |
| | 432 | ); |
| | 433 | } |
| 405 | 434 | } |
| 406 | 435 | |
| 407 | 436 | /** |