HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: /volume1/web/wordpress/wp-content/brizy/admin/abstract-widget.php
<?php

abstract class Brizy_Admin_AbstractWidget {

	abstract public function getId();

	abstract public function getName();

	abstract public function render();

	/**
	 * Brizy_Admin_AbstractWidget constructor.
	 * @throws Exception
	 */
	public function __construct() {
		wp_add_dashboard_widget( $this->internalGetId(), $this->getName(), array( $this, 'render' ) );
	}

	/**
	 * @return string
	 * @throws Exception
	 */
	protected function internalGetId() {
		$id = $this->getId();

		if ( empty( $id ) ) {
			throw new Exception( 'You should return an Id for the widget' );
		}

		return Brizy_Editor::get_slug() . '_' . $id;
	}
}