- Timestamp:
- 09/30/2025 05:04:35 PM (2 months ago)
- Location:
- branches/5.4
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/class-wp-customize-nav-menus.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
- Property svn:mergeinfo changed
/trunk merged: 60814-60816
- Property svn:mergeinfo changed
-
branches/5.4/src/wp-includes/class-wp-customize-nav-menus.php
r47383 r60832 159 159 } elseif ( 'post' !== $object && 0 === $page && $post_type->has_archive ) { 160 160 // Add a post type archive link. 161 $title = $post_type->labels->archives; 161 162 $items[] = array( 162 'id' => $object . '-archive', 163 'title' => $post_type->labels->archives, 164 'type' => 'post_type_archive', 165 'type_label' => __( 'Post Type Archive' ), 166 'object' => $object, 167 'url' => get_post_type_archive_link( $object ), 163 'id' => $object_name . '-archive', 164 'title' => $title, 165 'original_title' => $title, 166 'type' => 'post_type_archive', 167 'type_label' => __( 'Post Type Archive' ), 168 'object' => $object_name, 169 'url' => get_post_type_archive_link( $object_name ), 168 170 ); 169 171 } … … 199 201 $post_title = sprintf( __( '#%d (no title)' ), $post->ID ); 200 202 } 203 204 $post_type_label = get_post_type_object( $post->post_type )->labels->singular_name; 205 $post_states = get_post_states( $post ); 206 if ( ! empty( $post_states ) ) { 207 $post_type_label = implode( ',', $post_states ); 208 } 209 210 $title = html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ); 201 211 $items[] = array( 202 'id' => "post-{$post->ID}", 203 'title' => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ), 204 'type' => 'post_type', 205 'type_label' => get_post_type_object( $post->post_type )->labels->singular_name, 206 'object' => $post->post_type, 207 'object_id' => intval( $post->ID ), 208 'url' => get_permalink( intval( $post->ID ) ), 212 'id' => "post-{$post->ID}", 213 'title' => $title, 214 'original_title' => $title, 215 'type' => 'post_type', 216 'type_label' => $post_type_label, 217 'object' => $post->post_type, 218 'object_id' => (int) $post->ID, 219 'url' => get_permalink( (int) $post->ID ), 209 220 ); 210 221 } … … 230 241 231 242 foreach ( $terms as $term ) { 243 $title = html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ); 232 244 $items[] = array( 233 'id' => "term-{$term->term_id}", 234 'title' => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ), 235 'type' => 'taxonomy', 236 'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name, 237 'object' => $term->taxonomy, 238 'object_id' => intval( $term->term_id ), 239 'url' => get_term_link( intval( $term->term_id ), $term->taxonomy ), 245 'id' => "term-{$term->term_id}", 246 'title' => $title, 247 'original_title' => $title, 248 'type' => 'taxonomy', 249 'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name, 250 'object' => $term->taxonomy, 251 'object_id' => (int) $term->term_id, 252 'url' => get_term_link( (int) $term->term_id, $term->taxonomy ), 240 253 ); 241 254 }
Note: See TracChangeset
for help on using the changeset viewer.