LLMS_Post_Model::get_date( string $key, string $format = null )
Getter for date strings with optional date format conversion
Description Description
If no format is supplied, the default format available via $this->get_date_format() will be used.
Parameters Parameters
- $key
-
(string) (Required) Property key.
- $format
-
(string) (Optional) Any valid date format that can be passed to date().
Default value: null
Return Return
(string)
Source Source
File: includes/abstracts/abstract.llms.post.model.php
/**
* Filters the date(s)
*
* The first dynamic portion of this hook, `$this->model_post_type`, refers to the model's post type. For example "course",
* "lesson", "membership", etc...
* The second dynamic part of this hook, `$key`, refers to the date property name.
*
* @since 3.0.0
*
* @param string $date The formatted date.
* @param LLMS_Post_Model $llms_post The LLMS_Post_Model instance.
*/
return apply_filters( "llms_get_{$this->model_post_type}_{$key}_date", $date, $this );
}
/**
* Retrieve the default date format for the post model
*
* This *can* be overridden by child classes if the post type requires a different default date format.
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |