English (United Kingdom)
1.4.0

This is the widget main file.

Here below you can see an example of a widget:

<?php
/**
 * @package     VikRentCar
 * @subpackage  custom_two_admin_widget
 * @license     GNU General Public License version 2 or later; see LICENSE
 * @link        https://vikwp.com
 */

defined('ABSPATH') or die('No script kiddies please!');

/**
 * Class handler for admin widget "custom two".
 * 
 * @since 	1.4.0
 */
class VikRentCarAdminWidgetCustomTwo extends VikRentCarAdminWidget
{
	/**
	 * Class constructor will define the widget name and description.
	 */
	public function __construct()
	{
		// call parent constructor
		parent::__construct();

		$this->widgetName = 'Custom Two';
		$this->widgetDescr = 'Description for admin widget custom two...';
	}

	/**
	 * Render method will output the content of the widget.
	 */
	public function render($data = null)
	{
		?>
		<div class="vrc-admin-widget-wrapper">
			<div class="vrc-admin-widget-head">
				<h4><?php echo $this->getName(); ?></h4>
			</div>
			<div class="vrc-admin-widget-body">
				<?php echo '<p class="info">Hey, I am a custom admin widget for VikRentCar called &quot;' . $this->getName() . '&quot;.</p>'; ?>
				<p>I can send HTML contents to output, and I can perform operations through PHP.</p>
			</div>
		</div>
		<?php
	}
}
Last Update: 2021-11-17
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.