Changeset 11651 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-breadcrumbs.php
- Timestamp:
- 03/08/2022 07:03:14 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/template-parts/component-breadcrumbs.php
r10513 r11651 15 15 ); 16 16 17 // Get information about the post title. 18 $cpt_object = get_post_type_object( get_post_type( get_queried_object() ) ); 17 if ( is_post_type_archive() ) { 18 array_push( $crumbs, array( 19 'label' => post_type_archive_title( '', false ), 20 'url' => '', 21 )); 22 } elseif ( is_singular() ) { 23 if ( is_single() ) { 24 $cpt_object = get_post_type_object( get_post_type() ); 19 25 20 if ( 'lesson-plan' === get_post_type() ) { 26 array_push($crumbs, array( 27 'label' => $cpt_object->label, 28 'url' => home_url( $cpt_object->has_archive ), 29 )); 30 } 21 31 array_push( $crumbs, array( 22 'label' => ucfirst( $cpt_object->labels->name),23 'url' => home_url( $cpt_object->has_archive ),32 'label' => get_the_title(), 33 'url' => '', 24 34 ) ); 35 } elseif ( is_search() ) { 36 array_push( $crumbs, array( 37 'label' => get_search_query(), 38 'url' => '', 39 )); 25 40 } 26 27 array_push( $crumbs, array(28 'label' => get_the_title(),29 'url' => '',30 ) );31 41 ?> 32 42
Note: See TracChangeset
for help on using the changeset viewer.