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
4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 | 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
Version | Description |
---|---|
DozentLMS 1.0.0 | Introduced. |