I want to customize the breadcrumbs directly from PHP. Some of the pages are generated dynamically and do not exist in the database, therefore i must automatically put them in the breadcrumbs with some sort of PHP script.
I don't need to change default stuff, like homepage url, separators, etc...but i actually need to manually put some pages in the breadcrumbs. I was trying with some filterings and some hooks.
I've read the documentation but it just explains how to change default stuff.
How can i change the actual content of the breadcrumbs?
I tried this:
add_filter( 'woocommerce_breadcrumb', 'change_breadcrumb' );
function change_breadcrumb( $defaults ) {
// Change the breadcrumb home text from 'Home' to 'Appartment'
//do something
return $defaults;
}
But the //do something
never executes. It's like if that filter never gets called