Hi all,
This might be a super weird question, and there may well be a better way to do this but here's what I'm looking to accomplish:
The Setup
There's a plugin for handling events, it's very basic, which is exactly what I need. In that plugin, there's a custom field "event_date". This field spits out a Unix timestamp. I have a function that can convert that timestamp to human readable format (Month, Year) for use in Bricks Builder:
// Return with {echo:xxxx_event_human_date}
function xxxx_event_human_date() {
$the_event_start_date = get_post_meta(get_the_ID(), 'event_date', true);
$the_event_start_date = date('F, Y', $the_event_date);
return $the_event_start_date ?: '';
}
What I want to do is add that human readable value to custom field created with Metabox, which would (in my brain) then create a text value of Month, Year.
This text value would then be used with WP Grid Builder in order to filter events by their month and year value.
The Asks
1) Will this even work?
2) How can I accomplish this auto conversion and population into the Metabox field, if it is possible?
I'm VERY new to PHP, so I have no idea what's possible and what's not.
Cheers!
Pete