Skip to content

Instantly share code, notes, and snippets.

@webdados
Created September 22, 2020 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/f172643104a3b7e6ba63be861e579d85 to your computer and use it in GitHub Desktop.
Save webdados/f172643104a3b7e6ba63be861e579d85 to your computer and use it in GitHub Desktop.
First and last day of the month as "Magic coupon" HTML message
<?php
add_filter( 'magic_coupon_html_message_replace_tags', 'bf_magic_coupon_html_message_replace_tags' );
function bf_magic_coupon_html_message_replace_tags( $tags ) {
$tags['date_first_day_month'] = date_i18n( get_option( 'date_format' ), strtotime( date_i18n( 'Y-m-01' ) ) );
$tags['date_last_day_month'] = date_i18n( get_option( 'date_format' ), strtotime( date_i18n( 'Y-m-t' ) ) );
return $tags;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment