llms_sd_dashboard_date_widget( string $title, int $timestamp, string $empty_text = '' )

Displays a date widget


Parameters Parameters

$title

(string) (Required) Title of the widget.

$timestamp

(int) (Required) Timestamp used to display the date.

$empty_text

(string) (Optional) Content (text) to display if $content is empty.

Default value: ''


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/functions/llms.functions.templates.dashboard.widgets.php

function llms_sd_dashboard_date_widget( $title, $timestamp, $empty_text = '' ) {

	$html = '';
	if ( $timestamp ) {
		ob_start();
		?>
		<div class="llms-sd-date">
			<span class="month"><?php echo date_i18n( 'F', $timestamp ); ?></span>
			<span class="day"><?php echo date_i18n( 'j', $timestamp ); ?></span>
			<span class="year"><?php echo date_i18n( 'Y', $timestamp ); ?></span>
			<span class="diff"><?php printf( __( '%s ago', 'lifterlms' ), llms_get_date_diff( $timestamp, current_time( 'timestamp' ) ) ); ?>
		</div>
		<?php
		$html = ob_get_clean();
	}

	llms_sd_dashboard_widget( $title, $html, $empty_text );

}


Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.