// Check and get a term meta if ( metadata_exists( 'term', $term_id, '_meta_key' ) ) { $meta_value= get_term_meta( $term_id, '_meta_key', true ); } // Check and get a post meta if ( metadata_exists( 'post', $post_id, '_meta_key' ) ) { $meta_value= get_post_meta( $post_id, '_meta_key', true ); } // Check and get a user meta if ( metadata_exists( 'user', $user_id, '_meta_key' ) ) { $meta_value= get_user_meta( $user_id, '_meta_key', true ); }