�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 1 ) ) { $breadcrumb_items[] = array( 'label' => __( 'Home' ), 'url' => home_url( '/' ), ); } else { $breadcrumb_items[] = block_core_breadcrumbs_create_item( __( 'Home' ), block_core_breadcrumbs_is_paged() ); } } // Handle home. if ( $is_home ) { // These checks are explicitly nested in order not to execute the `else` branch. if ( $page_for_posts ) { $breadcrumb_items[] = block_core_breadcrumbs_create_item( block_core_breadcrumbs_get_post_title( $page_for_posts ), block_core_breadcrumbs_is_paged() ); } if ( block_core_breadcrumbs_is_paged() ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } } elseif ( $is_front_page ) { // Handle front page. // This check is explicitly nested in order not to execute the `else` branch. // If front page is set to custom page and is paged, add the page number. if ( (int) get_query_var( 'page' ) > 1 ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( 'page' ); } } elseif ( is_search() ) { // Handle search results. $is_paged = block_core_breadcrumbs_is_paged(); /* translators: %s: search query */ $text = sprintf( __( 'Search results for: "%s"' ), wp_trim_words( get_search_query(), 10 ) ); $breadcrumb_items[] = block_core_breadcrumbs_create_item( $text, $is_paged ); // Add the "Page X" as the current page if paginated. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } } elseif ( is_404() ) { // Handle 404 pages. $breadcrumb_items[] = array( 'label' => __( 'Page not found' ), ); } elseif ( is_archive() ) { // Handle archive pages (taxonomy, post type, date, author archives). $archive_breadcrumbs = block_core_breadcrumbs_get_archive_breadcrumbs(); if ( ! empty( $archive_breadcrumbs ) ) { $breadcrumb_items = array_merge( $breadcrumb_items, $archive_breadcrumbs ); } } else { // Handle single post/page breadcrumbs. if ( ! isset( $block->context['postId'] ) || ! isset( $block->context['postType'] ) ) { return ''; } $post_id = $block->context['postId']; $post_type = $block->context['postType']; $post = get_post( $post_id ); if ( ! $post ) { return ''; } // For non-hierarchical post types with parents (e.g., attachments), build trail for the parent. $post_parent = $post->post_parent; $parent_post = null; if ( ! is_post_type_hierarchical( $post_type ) && $post_parent ) { $parent_post = get_post( $post_parent ); if ( $parent_post ) { $post_id = $parent_post->ID; $post_type = $parent_post->post_type; $post_parent = $parent_post->post_parent; } } // Determine breadcrumb type. // Some non-hierarchical post types (e.g., attachments) can have parents. // Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs. $show_terms = false; if ( ! is_post_type_hierarchical( $post_type ) && ! $post_parent ) { $show_terms = true; } elseif ( empty( get_object_taxonomies( $post_type, 'objects' ) ) ) { $show_terms = false; } else { $show_terms = $attributes['prefersTaxonomy']; } // Add post type archive link if applicable. $post_type_object = get_post_type_object( $post_type ); $archive_link = get_post_type_archive_link( $post_type ); if ( $archive_link && untrailingslashit( home_url() ) !== untrailingslashit( $archive_link ) ) { $label = $post_type_object->labels->archives; if ( 'post' === $post_type && $page_for_posts ) { $label = block_core_breadcrumbs_get_post_title( $page_for_posts ); } $breadcrumb_items[] = array( 'label' => $label, 'url' => $archive_link, ); } // Build breadcrumb trail based on hierarchical structure or taxonomy terms. if ( ! $show_terms ) { $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) ); } else { $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) ); } // Add post title: linked when viewing a paginated page, plain text otherwise. $is_paged = (int) get_query_var( 'page' ) > 1 || (int) get_query_var( 'cpage' ) > 1; $title = block_core_breadcrumbs_get_post_title( $post ); if ( $is_paged ) { $breadcrumb_items[] = array( 'label' => $title, 'url' => get_permalink( $post ), 'allow_html' => true, ); $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item( (int) get_query_var( 'cpage' ) > 1 ? 'cpage' : 'page' ); } else { $breadcrumb_items[] = array( 'label' => $title, 'allow_html' => true, ); } } // Remove current item if disabled. if ( ! $attributes['showCurrentItem'] && ! empty( $breadcrumb_items ) ) { array_pop( $breadcrumb_items ); } /** * Filters the breadcrumb items array before rendering. * * Allows developers to modify, add, or remove breadcrumb items. * * @since 7.0.0 * * @param array[] $breadcrumb_items { * Array of breadcrumb item data. * * @type string $label The breadcrumb text. * @type string $url Optional. The breadcrumb link URL. * @type bool $allow_html Optional. Whether to allow HTML in the label. * When true, the label will be sanitized with wp_kses_post(), * allowing only safe HTML tags. When false or omitted, all HTML * will be escaped with esc_html(). Default false. * } */ $breadcrumb_items = apply_filters( 'block_core_breadcrumbs_items', $breadcrumb_items ); if ( empty( $breadcrumb_items ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => '--separator: "' . addcslashes( $attributes['separator'], '\\"' ) . '";', 'aria-label' => __( 'Breadcrumbs' ), ) ); $breadcrumb_html = sprintf( '', $wrapper_attributes, implode( '', array_map( static function ( $item ) { $label = ! empty( $item['allow_html'] ) ? wp_kses_post( $item['label'] ) : esc_html( $item['label'] ); if ( ! empty( $item['url'] ) ) { return '
  • ' . $label . '
  • '; } return '
  • ' . $label . '
  • '; }, $breadcrumb_items ) ) ); return $breadcrumb_html; } /** * Checks if we're on a paginated view (page 2 or higher). * * @since 7.0.0 * * @return bool True if paged > 1, false otherwise. */ function block_core_breadcrumbs_is_paged() { $paged = (int) get_query_var( 'paged' ); return $paged > 1; } /** * Creates a "Page X" breadcrumb item for paginated views. * * @since 7.0.0 * @param string $query_var Optional. Query variable to get current page number. Default 'paged'. * @return array The "Page X" breadcrumb item data. */ function block_core_breadcrumbs_create_page_number_item( $query_var = 'paged' ) { $paged = (int) get_query_var( $query_var ); if ( 'cpage' === $query_var ) { return array( 'label' => sprintf( /* translators: %s: comment page number */ __( 'Comments Page %s' ), number_format_i18n( $paged ) ), ); } return array( 'label' => sprintf( /* translators: %s: page number */ __( 'Page %s' ), number_format_i18n( $paged ) ), ); } /** * Creates a breadcrumb item that's either a link or current page item. * * When paginated (is_paged is true), creates a link to page 1. * Otherwise, creates a span marked as the current page. * * @since 7.0.0 * * @param string $text The text content. * @param bool $is_paged Whether we're on a paginated view. * * @return array The breadcrumb item data. */ function block_core_breadcrumbs_create_item( $text, $is_paged = false ) { $item = array( 'label' => $text ); if ( $is_paged ) { $item['url'] = get_pagenum_link( 1 ); } return $item; } /** * Gets a post title with fallback for empty titles. * * @since 7.0.0 * * @param int|WP_Post $post_id_or_object The post ID or post object. * * @return string The post title or fallback text. */ function block_core_breadcrumbs_get_post_title( $post_id_or_object ) { $title = get_the_title( $post_id_or_object ); if ( strlen( $title ) === 0 ) { $title = __( '(no title)' ); } return $title; } /** * Generates breadcrumb items from hierarchical post type ancestors. * * @since 7.0.0 * * @param int $post_id The post ID. * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_hierarchical_post_type_breadcrumbs( $post_id ) { $breadcrumb_items = array(); $ancestors = get_post_ancestors( $post_id ); $ancestors = array_reverse( $ancestors ); foreach ( $ancestors as $ancestor_id ) { $breadcrumb_items[] = array( 'label' => block_core_breadcrumbs_get_post_title( $ancestor_id ), 'url' => get_permalink( $ancestor_id ), 'allow_html' => true, ); } return $breadcrumb_items; } /** * Generates breadcrumb items for hierarchical term ancestors. * * For hierarchical taxonomies, retrieves and formats ancestor terms as breadcrumb links. * * @since 7.0.0 * * @param int $term_id The term ID. * @param string $taxonomy The taxonomy name. * * @return array Array of breadcrumb item data for ancestors. */ function block_core_breadcrumbs_get_term_ancestors_items( $term_id, $taxonomy ) { $breadcrumb_items = array(); // Check if taxonomy is hierarchical and add ancestor term links. if ( is_taxonomy_hierarchical( $taxonomy ) ) { $term_ancestors = get_ancestors( $term_id, $taxonomy, 'taxonomy' ); $term_ancestors = array_reverse( $term_ancestors ); foreach ( $term_ancestors as $ancestor_id ) { $ancestor_term = get_term( $ancestor_id, $taxonomy ); if ( $ancestor_term && ! is_wp_error( $ancestor_term ) ) { $breadcrumb_items[] = array( 'label' => $ancestor_term->name, 'url' => get_term_link( $ancestor_term ), ); } } } return $breadcrumb_items; } /** * Generates breadcrumb items for archive pages. * * Handles taxonomy archives, post type archives, date archives, and author archives. * For hierarchical taxonomies, includes ancestor terms in the breadcrumb trail. * * @since 7.0.0 * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_archive_breadcrumbs() { $breadcrumb_items = array(); // Date archive (check first since it doesn't have a queried object). if ( is_date() ) { $year = get_query_var( 'year' ); $month = get_query_var( 'monthnum' ); $day = get_query_var( 'day' ); // Fallback to 'm' query var for plain permalinks. // Plain permalinks use ?m=YYYYMMDD format instead of separate query vars. if ( ! $year ) { $m = get_query_var( 'm' ); if ( $m ) { $year = substr( $m, 0, 4 ); $month = substr( $m, 4, 2 ); $day = (int) substr( $m, 6, 2 ); } } $is_paged = block_core_breadcrumbs_is_paged(); if ( $year ) { if ( $month ) { // Year is linked if we have month. $breadcrumb_items[] = array( 'label' => $year, 'url' => get_year_link( $year ), ); if ( $day ) { // Month is linked if we have day. $breadcrumb_items[] = array( 'label' => date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), 'url' => get_month_link( $year, $month ), ); // Add day (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $day, $is_paged ); } else { // Add month (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( date_i18n( 'F', mktime( 0, 0, 0, $month, 1, $year ) ), $is_paged ); } } else { // Add year (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $year, $is_paged ); } } // Add pagination breadcrumb if on a paged date archive. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } return $breadcrumb_items; } // For other archive types, we need a queried object. $queried_object = get_queried_object(); if ( ! $queried_object ) { return array(); } $is_paged = block_core_breadcrumbs_is_paged(); // Taxonomy archive (category, tag, custom taxonomy). if ( $queried_object instanceof WP_Term ) { $term = $queried_object; $taxonomy = $term->taxonomy; // Add hierarchical term ancestors if applicable. $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy ) ); // Add current term (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $term->name, $is_paged ); } elseif ( is_post_type_archive() ) { // Post type archive. $post_type = get_query_var( 'post_type' ); if ( is_array( $post_type ) ) { $post_type = reset( $post_type ); } $post_type_object = get_post_type_object( $post_type ); /** This filter is documented in wp-includes/general-template.php */ $title = apply_filters( 'post_type_archive_title', $post_type_object->labels->archives, $post_type ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound if ( $post_type_object ) { // Add post type (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $title ? $title : $post_type_object->labels->archives, $is_paged ); } } elseif ( is_author() ) { // Author archive. $author = $queried_object; // Add author (current if not paginated, link if paginated). $breadcrumb_items[] = block_core_breadcrumbs_create_item( $author->display_name, $is_paged ); } // Add pagination breadcrumb if on a paged archive. if ( $is_paged ) { $breadcrumb_items[] = block_core_breadcrumbs_create_page_number_item(); } return $breadcrumb_items; } /** * Generates breadcrumb items from taxonomy terms. * * Finds the first publicly queryable taxonomy with terms assigned to the post * and generates breadcrumb links, including hierarchical term ancestors if applicable. * * @since 7.0.0 * * @param int $post_id The post ID. * @param string $post_type The post type name. * * @return array Array of breadcrumb item data. */ function block_core_breadcrumbs_get_terms_breadcrumbs( $post_id, $post_type ) { $breadcrumb_items = array(); // Get public taxonomies for this post type. $taxonomies = wp_filter_object_list( get_object_taxonomies( $post_type, 'objects' ), array( 'publicly_queryable' => true, 'show_in_rest' => true, ) ); if ( empty( $taxonomies ) ) { return $breadcrumb_items; } /** * Filters breadcrumb settings (taxonomy and term selection) for a post or post type. * * Allows developers to specify which taxonomy and term should be used in the * breadcrumb trail when a post type has multiple taxonomies or when a post is * assigned to multiple terms within a taxonomy. * * @since 7.0.0 * * @param array $settings { * Array of breadcrumb settings. Default empty array. * * @type string $taxonomy Optional. Taxonomy slug to use for breadcrumbs. * The taxonomy must be registered for the post type and have * terms assigned to the post. If not found or has no terms, * fall back to the first available taxonomy with terms. * @type string $term Optional. Term slug to use when the post has multiple terms * in the selected taxonomy. If the term is not found or not * assigned to the post, fall back to the first term. If the * post has only one term, that term is used regardless. * } * @param string $post_type The post type slug. * @param int $post_id The post ID. */ $settings = apply_filters( 'block_core_breadcrumbs_post_type_settings', array(), $post_type, $post_id ); $taxonomy_name = null; $terms = array(); // Try preferred taxonomy first if specified. if ( ! empty( $settings['taxonomy'] ) ) { foreach ( $taxonomies as $taxonomy ) { if ( $taxonomy->name === $settings['taxonomy'] ) { $post_terms = get_the_terms( $post_id, $taxonomy->name ); if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { $taxonomy_name = $taxonomy->name; $terms = $post_terms; } break; } } } // If no preferred taxonomy or it didn't have terms, find the first taxonomy with terms. if ( empty( $terms ) ) { foreach ( $taxonomies as $taxonomy ) { $post_terms = get_the_terms( $post_id, $taxonomy->name ); if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { $taxonomy_name = $taxonomy->name; $terms = $post_terms; break; } } } if ( ! empty( $terms ) ) { // Select which term to use. $term = reset( $terms ); // Try preferred term if specified and post has multiple terms. if ( ! empty( $settings['term'] ) && count( $terms ) > 1 ) { foreach ( $terms as $candidate_term ) { if ( $candidate_term->slug === $settings['term'] ) { $term = $candidate_term; break; } } } // Add hierarchical term ancestors if applicable. $breadcrumb_items = array_merge( $breadcrumb_items, block_core_breadcrumbs_get_term_ancestors_items( $term->term_id, $taxonomy_name ) ); $breadcrumb_items[] = array( 'label' => $term->name, 'url' => get_term_link( $term ), ); } return $breadcrumb_items; } /** * Registers the `core/breadcrumbs` block on the server. * * @since 7.0.0 */ function register_block_core_breadcrumbs() { register_block_type_from_metadata( __DIR__ . '/breadcrumbs', array( 'render_callback' => 'render_block_core_breadcrumbs', ) ); } add_action( 'init', 'register_block_core_breadcrumbs' );