/** * Add {date_created} merge tag and format the values using format_date * * @since 1.16 * * @see http://docs.gravityview.co/article/331-date-created-merge-tag for usage information * * @param array $matches Array of Merge Tag matches found in text by preg_match_all * @param string $text Text to replace * @param array $form Gravity Forms form array * @param array $entry Entry array * @param bool $url_encode Whether to URL-encode output * * @return string Original text if {date_created} isn't found. Otherwise, replaced text. */ public function replace_merge_tag($matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false) { $return = $text; /** Use $this->name instead of date_created because Payment Date uses this as well*/ $date_created = rgar($entry, $this->name); foreach ($matches as $match) { $full_tag = $match[0]; $property = $match[1]; $formatted_date = GravityView_Merge_Tags::format_date($date_created, $property); $return = str_replace($full_tag, $formatted_date, $return); } return $return; }