gravityflow_date_format_current_step_merge_tag

Description

The gravityflow_date_format_current_step_merge_tag filter can be used to customize the date format returned by {current_step}

Parameters

ParameterTypeDefinition
$date_formatStringA date format string – defaults to the WordPress settings.
$current_stepStepThe current step for this entry.
$propertyStringModifier for the current step merge tag.

Examples

Return a custom date format with no time

Returns different date formats for {current_step:schedule} and {current_step:expiration} with no time.

add_filter( 'gravityflow_date_format_current_step_merge_tag', 'sb_gravityflow_date_format_current_step_merge_tag',10,3);
function sb_gravityflow_date_format_current_step_merge_tag($date_format,$current_step,$property) {
   if( $property == 'schedule' ) {
     $date_format = "m.d.y";
   } elseif( $property == 'expiration') {
     $date_format = "j, n, Y";
   }
   return $date_format;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?