@@ 196-211 (lines=16) @@ | ||
193 | 'post_type' => $object, |
|
194 | ) ) ); |
|
195 | ||
196 | foreach ( $posts as $post ) { |
|
197 | $post_title = $post->post_title; |
|
198 | if ( '' === $post_title ) { |
|
199 | /* translators: %d: ID of a post */ |
|
200 | $post_title = sprintf( __( '#%d (no title)' ), $post->ID ); |
|
201 | } |
|
202 | $items[] = array( |
|
203 | 'id' => "post-{$post->ID}", |
|
204 | 'title' => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ), |
|
205 | 'type' => 'post_type', |
|
206 | 'type_label' => get_post_type_object( $post->post_type )->labels->singular_name, |
|
207 | 'object' => $post->post_type, |
|
208 | 'object_id' => intval( $post->ID ), |
|
209 | 'url' => get_permalink( intval( $post->ID ) ), |
|
210 | ); |
|
211 | } |
|
212 | } elseif ( 'taxonomy' === $type ) { |
|
213 | $terms = get_terms( $object, array( |
|
214 | 'child_of' => 0, |
|
@@ 341-356 (lines=16) @@ | ||
338 | $posts = array_merge( $posts, $get_posts->posts ); |
|
339 | ||
340 | // Create items for posts. |
|
341 | foreach ( $posts as $post ) { |
|
342 | $post_title = $post->post_title; |
|
343 | if ( '' === $post_title ) { |
|
344 | /* translators: %d: ID of a post */ |
|
345 | $post_title = sprintf( __( '#%d (no title)' ), $post->ID ); |
|
346 | } |
|
347 | $items[] = array( |
|
348 | 'id' => 'post-' . $post->ID, |
|
349 | 'title' => html_entity_decode( $post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ), |
|
350 | 'type' => 'post_type', |
|
351 | 'type_label' => $post_type_objects[ $post->post_type ]->labels->singular_name, |
|
352 | 'object' => $post->post_type, |
|
353 | 'object_id' => intval( $post->ID ), |
|
354 | 'url' => get_permalink( intval( $post->ID ) ), |
|
355 | ); |
|
356 | } |
|
357 | ||
358 | // Query taxonomy terms. |
|
359 | $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' ); |