Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url is set to 1 #3

Closed
Androlax2 opened this issue Sep 9, 2021 · 0 comments · Fixed by #13
Closed

Url is set to 1 #3

Androlax2 opened this issue Sep 9, 2021 · 0 comments · Fixed by #13

Comments

@Androlax2
Copy link

Hi,

On blog pages, url in the breadcrumb for the last item is set to 1.

Here is a dump of my items :

array:2 [▼
  0 => array:2 [▼
    "label" => "Accueil"
    "url" => "http://dev.cormary.com:8888"
  ]
  1 => array:2 [▼
    "label" => "Acide hyaluronique"
    "url" => "1"
  ]
]

I think, it come from that :

if (is_category()) {
            return $this->add(
                single_cat_title('', false),
                true
            );
        }

Why is there a true as second parameter? I have set the method to :

protected function add(string $key, ?string $value = null, bool $blog = false)

I think $value is casted to a string when pushing the url in

 $this->breadcrumb->push(
            [
                'label' => $key,
                'url'   => $value,
            ]
        );
Log1x added a commit that referenced this issue Jul 29, 2023
enhance(crumb): Add the blog page `id` to the blog item
@Log1x Log1x closed this as completed in #13 Jul 29, 2023
Log1x added a commit that referenced this issue Jul 29, 2023
* enhance(crumb): Add the blog page `id` to the blog item
* chore(docs): Bump minimum required version to 7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant