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.