How to override class-wc-breadcrumb.php
-
I want to make a slight amendment to the file woocommerce/includes/class-wc-breadcrumb.php
/** * Product tag trail. */ private function add_crumbs_product_tag() { $current_term = $GLOBALS['wp_query']->get_queried_object(); $this->prepend_shop_page(); /* translators: %s: product tag */ $this->add_crumb( sprintf( __( 'Products tagged “%s”', 'woocommerce' ), $current_term->name ) ); }
I want to edit it to this:
/** * Product tag trail. */ private function add_crumbs_product_tag() { $current_term = $GLOBALS['wp_query']->get_queried_object(); $this->prepend_shop_page(); /* translators: %s: product tag */ $this->add_crumb( sprintf( __( '%s', 'woocommerce' ), $current_term->name ) ); }
But I don’t want to overwrite the original WC plugin file. Is there a way to do this by override via functions.php?
Thanks,
Danny
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘How to override class-wc-breadcrumb.php’ is closed to new replies.