* @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Plugins\Polls; use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Classes\Forms; class PollForms extends Forms { /** * Adds these functions to the form list. */ public function __construct() { self::addHandler( 'createPoll', __CLASS__, 'createPoll' ); } /** * Validates the createPoll form. * * @return {bool} */ public static function createPoll() { if ( ! Input::exists( 'poll' ) ) { Check::addUserError( 'You must provide a poll.' ); return false; } return true; } } new PollForms;