src/lib/Breadcrumbs.php
protected function add_singular_links()
    {
        if (($post = \get_post())->post_parent) {
            $parent_id = $post->post_parent;

            $single_links = [];

            while ($parent_id) {
                $parent = \get_post($parent_id);
                $single_links[] = $this->makeLink(
                    \get_the_title($parent->ID),
                    (\get_permalink($parent->ID) ?: '')
                );
                $parent_id = $parent->post_parent;
            }

            $this->links = \array_merge(
                $this->links,
                \array_reverse($single_links)
            );
        } elseif (!\is_post_type_hierarchical($post->post_type)) {
            if ($term = $this->getFirstTerm($post)) {
                $single_links = [];
                $term_id = \absint($term->term_id);

                while ($term_id) {
                    $term = \get_term_by('id', $term_id, $term->taxonomy);
                    $single_links[] = $this->makeLink(
                        $term->name,
                        $this->getTermLink(
                            \absint($term->term_id),
                            $term->taxonomy
                        )
                    );
                    $term_id = \absint($term->parent);
                }

                $this->links = \array_merge(
                    $this->links,
                    \array_reverse($single_links)
                );
            } elseif ('post' !== $post->post_type
                || ($page_for_posts = \get_option('page_for_posts'))
                // NB: 'post' archive is the same as frontpage unless page_for_posts is set
            ) { // Add post type archive link
                $post_type_object = \get_post_type_object($post->post_type);

                $label = (
                    'post' === $post->post_type && $page_for_posts
                    ? \get_the_title($page_for_posts)
                    : $post_type_object->labels->name
                );

                if (($post_type_link =
                    \get_post_type_archive_link($post->post_type))
                ) {
                    $this->links[] = $this->makeLink($label, $post_type_link);
                }
            }
        }

        $this->links[] = $this->currentLink(
            \get_the_title($post->ID),
            (\get_permalink($post->ID) ?: '')
        );
    }
protected function add_singular_links()
    {
        if (($post = \get_post())->post_parent) {
            $parent_id = $post->post_parent;

            $single_links = [];

            while ($parent_id) {
                $parent = \get_post($parent_id);
                $single_links[] = $this->makeLink(
                    \get_the_title($parent->ID),
                    (\get_permalink($parent->ID) ?: '')
                );
                $parent_id = $parent->post_parent;
            }

            $this->links = \array_merge(
                $this->links,
                \array_reverse($single_links)
            );
        } elseif (!\is_post_type_hierarchical($post->post_type)) {
            if ($term = $this->getFirstTerm($post)) {
                $single_links = [];
                $term_id = \absint($term->term_id);

                while ($term_id) {
                    $term = \get_term_by('id', $term_id, $term->taxonomy);
                    $single_links[] = $this->makeLink(
                        $term->name,
                        $this->getTermLink(
                            \absint($term->term_id),
                            $term->taxonomy
                        )
                    );
                    $term_id = \absint($term->parent);
                }

                $this->links = \array_merge(
                    $this->links,
                    \array_reverse($single_links)
                );
            } elseif ('post' !== $post->post_type
                || ($page_for_posts = \get_option('page_for_posts'))
                // NB: 'post' archive is the same as frontpage unless page_for_posts is set
            ) { // Add post type archive link
                $post_type_object = \get_post_type_object($post->post_type);

                $label = (
                    'post' === $post->post_type && $page_for_posts
                    ? \get_the_title($page_for_posts)
                    : $post_type_object->labels->name
                );

                if (($post_type_link =
                    \get_post_type_archive_link($post->post_type))
                ) {
                    $this->links[] = $this->makeLink($label, $post_type_link);
                }
            }
        }

        $this->links[] = $this->currentLink(
            \get_the_title($post->ID),
            (\get_permalink($post->ID) ?: '')
        );
    }
Called if $page === 'singular'