WordPress redefine class or class method on child theme
-
I have a theme on WordPress called A and his child called A-child.
On A child I have on A/includes/projects.php a class called project and I want to redifend one method inside this class called method1().
First that I tried is to re-create the same structured on A-child theme : A-child/includes/projects.php and on functions.php put the require_once but the site crashed. Without the require_once nothing happens.
The other thing that I tried is to redifined the method1() on functions.php and no luck, nothing happens again. I thought obvious, but no one knows.
EDIT:
I need that when on the A Theme call $project->method1(); execute the method1() redefined on my A-child Theme.
I only need to add one line but the parent theme has updated option and I don’t want to re write the same line everytime that I update it.
Moreover the method1() don’t have any do_action in order to be rewrite on functions.php.
PD: The method1() is called with add_ajax() I don’t know if it is usefull for us.
Any help?
The topic ‘WordPress redefine class or class method on child theme’ is closed to new replies.