override a class
-
Hi !
I would like to override the constructor of the YITH_WCBM_Frontend class from the class.yith-wcbm-frontend.php file. Because there’s a if(!class_exists(‘YITH_WCBM_Frontend’)), I thought I could just copy and paste the class in functions.php of my child theme and it would work. But it doesn’t, it throws an error which says : “Cannot declare class YITH_WCBM_Frontend, because the name is already in use in …/themes/north-wp-child/functions.php”.
I also tried to simply copy and paste the entire file in my-child-theme/yith-woocommerce-badges-management, but it doesn’t work either, the file isn’t called.
I tried to make an extends of the original class in functions.php too. But it doesn’t work…The !class_exists seems not to work on plugin territory (well, that’s what I figured out by looking a bit on the internet)
Do you have any idea? ??
- The topic ‘override a class’ is closed to new replies.