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.


Top ↑

Parameters Parameters

$key

(string) (Required) Property key.

$format

(string) (Optional) Any valid date format that can be passed to date().

Default value: null


Top ↑

Return Return

(string)


Top ↑

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.

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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