Text/Date metadata perform differently?
-
I am trying to expose certain EditFlow metadata on the frontend of a website. I have been able to repurpose code shared earlier in this forum to achieve the majority of what I want, but ran into trouble with dates. Maybe someone here could advise? I get no return for the final date option here and I’ve already confirmed that I have slug/type correct…
I have also posted this code on Gist.
function upcoming_info() { global $post, $edit_flow; $view = get_metadata( 'post', $post->ID, '', true ); $upcoming_assignment = $view[_ef_editorial_meta_paragraph_assignment][0]; if ($upcoming_assignment != null) : echo '<h4>Assignment</h4><p>' . $upcoming_assignment . '</p>'; endif; $upcoming_editor_id = $view[_ef_editorial_meta_user_editor][0]; if ($upcoming_editor_id != null) : $upcoming_editor = get_userdata($upcoming_editor_id); echo '<h4>Assigning Editor</h4> <p>' . $upcoming_editor->user_nicename . '</p>'; endif; $upcoming_available_date = $view[_ef_editorial_meta_date_planned-availability][0]; if ($upcoming_available_date != null) : $upcoming_available_date_human_format = date("F j, Y", $upcoming_available_date); echo '<h4>Planned Availability</h4> <p>' . $upcoming_available_date_human_format . '</p>'; endif; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Text/Date metadata perform differently?’ is closed to new replies.