dozent_get_datetime_property_names( string|null $property = null )

Get all date time properties, like hours => Hours, minutes => Minutes


Description

Example usage:

$properties = dozent_get_datetime_property_names(); //returns array
$property = dozent_get_datetime_property_names( $key ); //returns string

Parameters

$property

(string|null) (Optional) property Key

Default value: null


Return

(mixed|void)


Source

File: includes/core-functions.php

	function dozent_get_datetime_property_names( $property = null ) {

		$properties = [
			'years'   => __( 'Years', 'dozent' ),
			'months'  => __( 'Months', 'dozent' ),
			'days'    => __( 'Days', 'dozent' ),
			'minutes' => __( 'Minutes', 'dozent' ),
			'seconds' => __( 'Seconds', 'dozent' ),
		];

		if ( $property ) {
			/**
			 * Filter single date time property name
			 *
			 * @since DozentLMS 1.0.0
			 *
			 * @param  string  $name  Property name
			 * @param  string  $property  Property key
			 */

			return apply_filters( 'dozent_get_datetime_property_name', dozent_array_get( $property, $properties ), $property );
		}

		/**
		 * Filter single date time properties
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param  array  $properties  All properties with key and name
		 */

		return apply_filters( 'dozent_get_datetime_property_names', $properties );
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.