for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the WPFoundation library.
*
* Copyright (c) 2015-present LIN3S <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LIN3S\WPFoundation\Widgets;
/**
* Abstract class of base Widget that implements the interface.
* @author Beñat Espiña <[email protected]>
abstract class Widget extends \WP_Widget implements WidgetInterface
{
* Constructor.
* @param string $id The name id
* @param string $name The name
* @param array $description The description
public function __construct($id, $name, $description)
parent::__construct($id, $name, ['description' => $description]);
add_action('widgets_init', [$this, 'register']);
add_action()
}
* {@inheritdoc}
public function name()
return $this->id_base;
public function number()
return $this->number;
public function register()
register_widget(static::class);
register_widget()