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 3 years, 5 months ago by
syoung68.