--- a/wp/wp-includes/class-wp-customize-nav-menus.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/class-wp-customize-nav-menus.php Wed Sep 21 18:19:35 2022 +0200
@@ -249,8 +249,8 @@
'type' => 'post_type',
'type_label' => $post_type_label,
'object' => $post->post_type,
- 'object_id' => intval( $post->ID ),
- 'url' => get_permalink( intval( $post->ID ) ),
+ 'object_id' => (int) $post->ID,
+ 'url' => get_permalink( (int) $post->ID ),
);
}
} elseif ( 'taxonomy' === $type ) {
@@ -281,8 +281,8 @@
'type' => 'taxonomy',
'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
'object' => $term->taxonomy,
- 'object_id' => intval( $term->term_id ),
- 'url' => get_term_link( intval( $term->term_id ), $term->taxonomy ),
+ 'object_id' => (int) $term->term_id,
+ 'url' => get_term_link( (int) $term->term_id, $term->taxonomy ),
);
}
}
@@ -410,8 +410,8 @@
'type' => 'post_type',
'type_label' => $post_type_label,
'object' => $post->post_type,
- 'object_id' => intval( $post->ID ),
- 'url' => get_permalink( intval( $post->ID ) ),
+ 'object_id' => (int) $post->ID,
+ 'url' => get_permalink( (int) $post->ID ),
);
}
@@ -436,8 +436,8 @@
'type' => 'taxonomy',
'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
'object' => $term->taxonomy,
- 'object_id' => intval( $term->term_id ),
- 'url' => get_term_link( intval( $term->term_id ), $term->taxonomy ),
+ 'object_id' => (int) $term->term_id,
+ 'url' => get_term_link( (int) $term->term_id, $term->taxonomy ),
);
}
}
@@ -488,6 +488,7 @@
$temp_nav_menu_item_setting = new WP_Customize_Nav_Menu_Item_Setting( $this->manager, 'nav_menu_item[-1]' );
$num_locations = count( get_registered_nav_menus() );
+
if ( 1 === $num_locations ) {
$locations_description = __( 'Your theme can display menus in one location.' );
} else {
@@ -679,7 +680,8 @@
// Menu locations.
$locations = get_registered_nav_menus();
$num_locations = count( $locations );
- if ( 1 == $num_locations ) {
+
+ if ( 1 === $num_locations ) {
$description = '<p>' . __( 'Your theme can display menus in one location. Select which menu you would like to use.' ) . '</p>';
} else {
/* translators: %s: Number of menu locations. */