Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get the editorial metadata value for a given term
* Output the value for an editorial metadata term
* @see
function photo_credit() {
global $edit_flow;
// Don't cause any fatal errors if Edit Flow or editorial metadata are deactivated
if ( !is_object( $edit_flow ) || $edit_flow->helpers->module_enabled( 'editorial-metadata' ) )
// Get the editorial metadata term you want the postmeta value for by slug
$term = $edit_flow->editorial_metadata->get_editorial_metadata_term_by( 'slug', 'photo-credit' );
// Get the postmeta value for the current post
$value = $edit_flow->editorial_metadata->get_postmeta_value( $term, get_queried_object_id() );
// Echo the value
echo "Photo credit: " . $value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment