Support » Plugin: WP Telegram (Auto Post and Notifications) » Custom Field Date

  • Resolved arthurcarlos

    (@arthurcarlos)


    Hi. How can I format the custom field which is a date?

    I want to show as DD/MM/YYYY but now it’s shown as YYYYMMDD.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Manzoor Wani

    (@manzoorwanijk)

    Hello,
    The format used for date is what you have set in wp-admin > Settings.

    Hi Manzoor.

    No, it’s not that. The WP Settings is ok.

    I’m using the ACF Plugin for my custom fields. Is that a problem?

    Take a look: https://prnt.sc/pin3ut

    • This reply was modified 1 month, 3 weeks ago by arthurcarlos.
    Plugin Author Manzoor Wani

    (@manzoorwanijk)

    Is there any option to set the date format in ACF, if not then it needs custom code to get the job done. In that case, what’s the field name in ACF?

    Yes, it’s set to the DD/MM/YYYY on the visual format.

    The name is: {cf:data_do_jogo}

    Plugin Author Manzoor Wani

    (@manzoorwanijk)

    Here is the code you can use:

    /* WP Telegram | Get field value from ACF */
    add_filter(
    	'wptelegram_p2tg_post_data_cf:data_do_jogo_value',
    	function ( $value, $post ) {
    		if ( function_exists( 'get_field' ) ) {
    			$value = get_field( 'data_do_jogo', $post->ID );
    		}
    		return $value;
    	},
    	10,
    	2
    );
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.