Widgets
WordPress Widgets can be registered with Ayuco or added manually to the Main Class.
Ayuco Command
php ayuco register widget:{widget}
{widget} | The widget's class name (i.e. MyWidget). |
Example:
php ayuco register widget:MyWidget
Ayuco will create a new folder, called "Widgets", inside the framework's "app" folder and will create the class named in the command.
Add Manually
Stop And Think
Register widgets with Ayuco solves many issues, such as loading classes under no namespace and linking the Main Class. Is highly recommendable to use Ayuco for when registering widgets.Class widgets can be added manually by defining them in the Main Class.
class Main extends Bridge { public function init() { // Manual widget added, widget class "MyWidget". $this->add_widget( 'MyWidget' ); } }