--- a/wp/wp-includes/class-wp-customize-nav-menus.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/class-wp-customize-nav-menus.php Tue Sep 27 16:37:53 2022 +0200
@@ -131,17 +131,17 @@
*
* @since 4.3.0
*
- * @param string $type Optional. Accepts any custom object type and has built-in support for
- * 'post_type' and 'taxonomy'. Default is 'post_type'.
- * @param string $object Optional. Accepts any registered taxonomy or post type name. Default is 'page'.
- * @param int $page Optional. The page number used to generate the query offset. Default is '0'.
+ * @param string $object_type Optional. Accepts any custom object type and has built-in support for
+ * 'post_type' and 'taxonomy'. Default is 'post_type'.
+ * @param string $object_name Optional. Accepts any registered taxonomy or post type name. Default is 'page'.
+ * @param int $page Optional. The page number used to generate the query offset. Default is '0'.
* @return array|WP_Error An array of menu items on success, a WP_Error object on failure.
*/
- public function load_available_items_query( $type = 'post_type', $object = 'page', $page = 0 ) {
+ public function load_available_items_query( $object_type = 'post_type', $object_name = 'page', $page = 0 ) {
$items = array();
- if ( 'post_type' === $type ) {
- $post_type = get_post_type_object( $object );
+ if ( 'post_type' === $object_type ) {
+ $post_type = get_post_type_object( $object_name );
if ( ! $post_type ) {
return new WP_Error( 'nav_menus_invalid_post_type' );
}
@@ -152,7 +152,7 @@
*/
$important_pages = array();
$suppress_page_ids = array();
- if ( 0 === $page && 'page' === $object ) {
+ if ( 0 === $page && 'page' === $object_name ) {
// Insert Front Page or custom "Home" link.
$front_page = 'page' === get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
if ( ! empty( $front_page ) ) {
@@ -188,15 +188,15 @@
$suppress_page_ids[] = $privacy_policy_page->ID;
}
}
- } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) {
+ } elseif ( 'post' !== $object_name && 0 === $page && $post_type->has_archive ) {
// Add a post type archive link.
$items[] = array(
- 'id' => $object . '-archive',
+ 'id' => $object_name . '-archive',
'title' => $post_type->labels->archives,
'type' => 'post_type_archive',
'type_label' => __( 'Post Type Archive' ),
- 'object' => $object,
- 'url' => get_post_type_archive_link( $object ),
+ 'object' => $object_name,
+ 'url' => get_post_type_archive_link( $object_name ),
);
}
@@ -216,7 +216,7 @@
'offset' => 10 * $page,
'orderby' => 'date',
'order' => 'DESC',
- 'post_type' => $object,
+ 'post_type' => $object_name,
);
// Add suppression array to arguments for get_posts.
@@ -253,10 +253,10 @@
'url' => get_permalink( (int) $post->ID ),
);
}
- } elseif ( 'taxonomy' === $type ) {
+ } elseif ( 'taxonomy' === $object_type ) {
$terms = get_terms(
array(
- 'taxonomy' => $object,
+ 'taxonomy' => $object_name,
'child_of' => 0,
'exclude' => '',
'hide_empty' => false,
@@ -292,12 +292,12 @@
*
* @since 4.3.0
*
- * @param array $items The array of menu items.
- * @param string $type The object type.
- * @param string $object The object name.
- * @param int $page The current page number.
+ * @param array $items The array of menu items.
+ * @param string $object_type The object type.
+ * @param string $object_name The object name.
+ * @param int $page The current page number.
*/
- $items = apply_filters( 'customize_nav_menu_available_items', $items, $type, $object, $page );
+ $items = apply_filters( 'customize_nav_menu_available_items', $items, $object_type, $object_name, $page );
return $items;
}
@@ -476,7 +476,7 @@
}
/**
- * Enqueue scripts and styles for Customizer pane.
+ * Enqueues scripts and styles for Customizer pane.
*
* @since 4.3.0
*/
@@ -598,7 +598,7 @@
}
/**
- * Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass.
+ * Allows non-statically created settings to be constructed with custom WP_Customize_Setting subclass.
*
* @since 4.3.0
*
@@ -619,7 +619,7 @@
}
/**
- * Add the customizer settings and controls.
+ * Adds the customizer settings and controls.
*
* @since 4.3.0
*/
@@ -863,7 +863,7 @@
}
/**
- * Get the base10 intval.
+ * Gets the base10 intval.
*
* This is used as a setting's sanitize_callback; we can't use just plain
* intval because the second argument is not what intval() expects.
@@ -878,7 +878,7 @@
}
/**
- * Return an array of all the available item types.
+ * Returns an array of all the available item types.
*
* @since 4.3.0
* @since 4.7.0 Each array item now includes a `$type_label` in addition to `$title`, `$type`, and `$object`.
@@ -929,7 +929,7 @@
}
/**
- * Add a new `auto-draft` post.
+ * Adds a new `auto-draft` post.
*
* @since 4.7.0
*
@@ -1056,7 +1056,7 @@
}
/**
- * Print the JavaScript templates used to render Menu Customizer components.
+ * Prints the JavaScript templates used to render Menu Customizer components.
*
* Templates are imported into the JS use wp.template.
*
@@ -1119,7 +1119,7 @@
<script type="text/html" id="tmpl-nav-menu-create-menu-section-title">
<p class="add-new-menu-notice">
- <?php _e( 'It doesn’t look like your site has any menus yet. Want to build one? Click the button to start.' ); ?>
+ <?php _e( 'It does not look like your site has any menus yet. Want to build one? Click the button to start.' ); ?>
</p>
<p class="add-new-menu-notice">
<?php _e( 'You’ll create a menu, assign it a location, and add menu items like links to pages and categories. If your theme has multiple menu areas, you might need to create more than one.' ); ?>
@@ -1134,7 +1134,7 @@
}
/**
- * Print the HTML template used to render the add-menu-item frame.
+ * Prints the HTML template used to render the add-menu-item frame.
*
* @since 4.3.0
*/
@@ -1192,14 +1192,13 @@
}
/**
- * Print the markup for new menu items.
+ * Prints the markup for new menu items.
*
* To be used in the template #available-menu-items.
*
* @since 4.7.0
*
* @param array $available_item_type Menu item data to output, including title, type, and label.
- * @return void
*/
protected function print_post_type_container( $available_item_type ) {
$id = sprintf( 'available-menu-items-%s-%s', $available_item_type['type'], $available_item_type['object'] );
@@ -1237,11 +1236,9 @@
}
/**
- * Print the markup for available menu item custom links.
+ * Prints the markup for available menu item custom links.
*
* @since 4.7.0
- *
- * @return void
*/
protected function print_custom_links_available_menu_item() {
?>
@@ -1317,7 +1314,7 @@
}
/**
- * Add hooks for the Customizer preview.
+ * Adds hooks for the Customizer preview.
*
* @since 4.3.0
*/
@@ -1330,11 +1327,11 @@
}
/**
- * Make the auto-draft status protected so that it can be queried.
+ * Makes the auto-draft status protected so that it can be queried.
*
* @since 4.7.0
*
- * @global array $wp_post_statuses List of post statuses.
+ * @global stdClass[] $wp_post_statuses List of post statuses.
*/
public function make_auto_draft_status_previewable() {
global $wp_post_statuses;
@@ -1342,7 +1339,7 @@
}
/**
- * Sanitize post IDs for posts created for nav menu items to be published.
+ * Sanitizes post IDs for posts created for nav menu items to be published.
*
* @since 4.7.0
*
@@ -1372,7 +1369,7 @@
}
/**
- * Publish the auto-draft posts that were created for nav menu items.
+ * Publishes the auto-draft posts that were created for nav menu items.
*
* The post IDs will have been sanitized by already by
* `WP_Customize_Nav_Menu_Items::sanitize_nav_menus_created_posts()` to
@@ -1413,7 +1410,7 @@
}
/**
- * Keep track of the arguments that are being passed to wp_nav_menu().
+ * Keeps track of the arguments that are being passed to wp_nav_menu().
*
* @since 4.3.0
*
@@ -1517,7 +1514,7 @@
}
/**
- * Enqueue scripts for the Customizer preview.
+ * Enqueues scripts for the Customizer preview.
*
* @since 4.3.0
*/
@@ -1540,7 +1537,7 @@
}
/**
- * Export any wp_nav_menu() calls during the rendering of any partials.
+ * Exports any wp_nav_menu() calls during the rendering of any partials.
*
* @since 4.5.0
*
@@ -1553,7 +1550,7 @@
}
/**
- * Render a specific menu via wp_nav_menu() using the supplied arguments.
+ * Renders a specific menu via wp_nav_menu() using the supplied arguments.
*
* @since 4.3.0
*