How to extend a class in a wordpress plugin from theme?
-
I am trying to extend a class that is inside a plugin from my theme, but if I check the class to be extended with
if(class_exists('Hello_Class'))
I can see the class is not available. The plugin structure is something like this:` class PluginCore {
public static $info;function __construct() {
add_action( ‘after_setup_theme’, array( $this, ‘after_setup_theme’ ), 12 );
}function after_setup_theme() {
// the class I want extend
require_once ‘/Hello_Class.php’;
}}
new PluginCore();`I want to extend the class “Hello_Class”, I tried to get this work using hook like after_setup_theme and init, but nothing works. Is there a way to make this work.
- The topic ‘How to extend a class in a wordpress plugin from theme?’ is closed to new replies.