Skip to content

@danielbachhuber /gist:1764918
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Get the editorial metadata value for a given term
<?php
/**
* Output the value for an editorial metadata term
* @see http://wordpress.org/support/topic/plugin-edit-flow-exporting-editorial-metadata
*/
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' ) )
return;
// 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
Something went wrong with that request. Please try again.