How do I create Widget within plugin that uses its own class?
There’s no need to nest classes (and you can’t anyway), you just create a new instance of the class. The code below would automatically call the My_Widget class to create a widget based on your existing code. Class plugin_name { // Call the widget class public function __construct(){ $this->widget = new My_Widget(); $this->widget->getWidget(); } } … Read more