• Resolved mnguye08

    (@mnguye08)


    Hi,

    I’d like to know if there is a way to format the default shortcode [post_date] in french format (dd/mm/yyyy hh:ii:ss).

    I tried to create my own filter but it doesn’t work.

    add_filter('wp_mail', function($args) {
    	$date = date_create($args['post_date']);
    	$newdate = date_format($date, 'd/m/Y H:i:s');
    	$args['post_date'] = $newdate;
    
    	return $args;
    }, 1, 1);

    Thanks for your help!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @mnguye08,
    Thanks for your message.

    The [post_date] shortcode should automatically format the date that is stored in Settings > General in your WordPress Admin in the latest version of BNFW.

    Can you confirm that this is set to your desired format?
    You may also need to update your copy of WordPress.

    Thanks,
    Jack

    Thread Starter mnguye08

    (@mnguye08)

    Hi Jack,

    Sorry but it doesn’t seem to work.
    The date and time are already set to french format in Settings > General.

    Do you know why?

    Thanks for your help!

    Plugin Author bnfw

    (@voltronik)

    Hi @mnguye08,
    In testing it’s working as expected.

    Can you confirm that you’ve updated WordPress and are using the latest copy of BNFW?

    Thanks,
    Jack

    I am having a similar issue. [post_date] displays in the format of Universal Time Code (yyyy/mm/dd hh:mm:ss) and not the format I have in Settings > General. In my Admin panel, date format is set to: F j, Y and Time Format is set to: g:i a, such as January 26, 2018 and 3:00 PM.

    I have installed the latest WP version 4.9.2 and of BNWP 1.6.9 and yes I am using [post_date] and not [post_date_gmt]

    I am no stranger to PHP so if you could point me in the right direction, such as where the disconnect might be occurring, I would be happy to troubleshoot. Also, if you know of any filters or functions that could help, please let me know.

    Thanks!

    Your plugin is the best of the bunch, hands down.

    Plugin Author bnfw

    (@voltronik)

    Hi @davelmer,
    Thanks for your message too.

    Can you tell me what language you are using for WordPress?
    I test with US and UK variants of English but wonder if it’s an issue that isn’t present in these languages.

    Thanks,
    Jack

    Hi Jack,

    That would be the US variant of English…my apologies from across the Pond. ??

    Dave

    Plugin Author bnfw

    (@voltronik)

    Hi @davelmer,
    Thanks for clarifying.

    There are a few changes to this appearing in the next version of BNFW, due out very soon.
    Please let me know if you still have issues with this after the update.

    Thanks,
    Jack

    Jack,

    I updated the plugin and it works like a charm! Thank you for being so responsive.

    Dave

    Plugin Author bnfw

    (@voltronik)

    Hi @davelmer,
    Great! Glad it’s now working for you.

    If you like BNFW and the support, please feel free to leave an honest review.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom format [post_date] shortcode’ is closed to new replies.