Rank Math 麵包屑 Breadcrumbs 在 Taxonomy (分類法) 列表頁中插入指定的 Post Type Archive 項目

 add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    if (is_tax('destination_category')) {
        $labels = get_post_type_labels(get_post_type_object('destination'));
        $appends = [];
        $appends[] = array(
            "0" => $labels->name,
            "1" => get_post_type_archive_link('destination'),
            "hide_in_schema" => true
        );
        array_splice($crumbs, 1, 0, $appends);
    }
    return $crumbs;
}, 10, 2);