If you are in term archive page, the taxonomy and term is actually set. You could hook wp_head
to add the open graph in your functions.php:
add_action( 'wp_head', 'wpse_wp_head' );
function wpse_wp_head () {
//First, we check if we are in our custom taxonomy
if( is_tax('my-custom-taxonomy') ) {
$taxonomy_slug = get_query_var( 'taxonomy' );
$term_slug = get_query_var( 'term' );
$term_url = get_term_link( $term_slug, $taxonomy_slug );
//Add Open Graph property
echo '<meta property="og:url" content="'. esc_url( $term_url ) .'">';
//If you need the full object of current term
//$term = get_term_by( 'slug', $term_slug, $taxonomy_slug );
//Now you can get all the term data. For example:
//$term->name, $term->term_id, $term->slug,.....
}
}