Commit 9f0044ed authored by KR Moorhouse's avatar KR Moorhouse Committed by GitHub

Merge pull request #3082 from wpninjas/issue#3038

Add a merge tag for submission time.
parents 91943b0b 50fbf048
......@@ -178,6 +178,10 @@ class NF_Admin_CPT_Submission
echo apply_filters( 'nf_sub_table_seq_num', $sub->get_seq_num(), $sub_id, $column );
}
if( 'sub_date' == $column ) {
echo $sub->get_sub_date( 'm/d/Y h:i A' );
}
$form_id = absint( $_GET[ 'form_id' ] );
if( is_numeric( $column ) ){
......
......@@ -26,6 +26,19 @@ return apply_filters( 'ninja_forms_merge_tags_other', array(
'callback' => 'system_date'
),
/*
|--------------------------------------------------------------------------
| System Date
|--------------------------------------------------------------------------
*/
'time' => array(
'id' => 'time',
'tag' => '{other:time}',
'label' => __( 'Time', 'ninja_forms' ),
'callback' => 'system_time'
),
/*
|--------------------------------------------------------------------------
| System IP Address
......@@ -39,4 +52,4 @@ return apply_filters( 'ninja_forms_merge_tags_other', array(
'callback' => 'user_ip'
),
));
\ No newline at end of file
));
......@@ -89,6 +89,11 @@ final class NF_MergeTags_Other extends NF_Abstracts_MergeTags
return date( $format, time() );
}
protected function system_time()
{
return date_i18n( get_option( 'time_format' ), current_time( 'timestamp' ) );
}
protected function user_ip()
{
$ip = '127.0.0.1';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment