• Resolved syoung68

    (@syoung68)


    I know others have asked if you can wrap a custom field in a href tag, which would indeed be great, I am actually curios if there is a PHP filter I can use with custom fields to re format a date field. This solution could also work with links I think.

    Example: I have a deadline-date field that returns YYYY-MM-DD and I would like to display Month DD, YYYY (e.g. October 7, 2022)

    If I can filter on field name, I could rewrite how ever I need, something like this…

    
    if ( ('deadline-date' === $field_name ) && ($content != '')) {
    			return '<strong>Deadline:</strong> ' . date( get_option('date_format'), strtotime( $content ) );
    		}
    	
    		if ( ('email' === $field_name ) && ($content != '')) {
    			return '<a href="mailto:'.$content.'">'.$content.'</a>';
    		}

    `

    • This topic was modified 2 years, 5 months ago by syoung68.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    I guess the date format should be configured either at deadline-date field settings or at global WordPress settings at Dashboard > Settings > General.
    Please explain your question/request in more detail if I did not get it correctly.

    Plugin Support eugenewhite

    (@eugenewhite)

    Hello there!

    We haven’t heard from you in a while and will mark the topic as “Resolved”.
    In case you have any further concerns, please submit a new one and we’ll be glad to help you out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Format Custom Field Block’ is closed to new replies.