Title: Gravity forms &#8211; need  to modify common.php code
Last modified: August 21, 2016

---

# Gravity forms – need to modify common.php code

 *  [acastlenut](https://wordpress.org/support/users/acastlenut/)
 * (@acastlenut)
 * [12 years ago](https://wordpress.org/support/topic/gravity-forms-need-to-modify-commonphp-code/)
 * I am trying to create a php filter in a child theme’s functions.php to add the
   time, day of week etc in a gravity forms notifications structure.
    I have managed
   to change the correct code in gravity’s common.php to achieve this but when a
   new gravity update comes along this could be wiped out. In gravity the following
   is placed in the message box of notifications:-
 *     ```
       {all_fields:admin,value,empty}
       Entry ID: {entry_id}
       Date of Post: {date_dmy}
       User Agent:{user_agent}
       ```
   
 * The change I made in the common.php is as follows:-
 *     ```
       public static function replace_variables_prepopulate($text, $url_encode=false) {
   
       //date (mm/dd/yyyy) original code
               $local_date_mdy = date_i18n("m/d/Y", $local_timestamp, true);
               $text = str_replace("{date_mdy}", $url_encode ? urlencode($local_date_mdy) : $local_date_mdy, $text);
   
               //date (dd/mm/yyyy)
   
       	//$local_date_dmy = date_i18n("d/m/Y", $local_timestamp, true); -- replaced this line with:-
   
       	$local_date_dmy = date_i18n("d/m/Y  (g:i:s a) l (e)", $local_timestamp, true);
   
               $text = str_replace("{date_dmy}", $url_encode ? urlencode($local_date_dmy) : $local_date_dmy, $text);
       ```
   
 * Product of above code on a notification email
    Entry ID: 84 Date of Post: 08/
   04/2014 (5:18:23 pm) Tuesday (Australia/Adelaide) User Agent: Mozilla/5.0 (Windows
   NT 5.1; rv:28.0) Gecko/20100101 Firefox/28.
 * Cheers Eric

The topic ‘Gravity forms – need to modify common.php code’ is closed to new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [email](https://wordpress.org/support/topic-tag/email/)
 * [forms](https://wordpress.org/support/topic-tag/forms/)
 * [gravity](https://wordpress.org/support/topic-tag/gravity/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [acastlenut](https://wordpress.org/support/users/acastlenut/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/gravity-forms-need-to-modify-commonphp-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
