Hi,
I am using the custom tables plugin to save post_meta to a custom table. I use taxonomies extensively to categorize data and make it easy to sort on the front-end. I have written a function that will write the taxonomy names to a comma separated string in a text meta field for use in an outside reporting platform.
That function:
function obh_update_member_meta_w_tax() {
$member_needs_tags = get_the_terms( $post->ID, 'obh_member_needs_tags' );
if ( $member_needs_tags && ! is_wp_error( $member_needs_tags ) ) {
$needs_tags = array();
foreach ($member_needs_tags as $member_needs_tag) {
$needs_tag[] = $member_needs_tag->name;
}
$needs_tags = join( ", ", $needs_tag );
update_post_meta( $post->ID, 'obh_needs_tags', $needs_tags );
}
add_action( 'save_post', 'obh_update_member_meta_w_tax' );
When I update the post, the comma separated string saves to the post_meta table instead of the custom table.
Is there a MetaBox.io function equivalent to update_post_meta that will work to save the data to the custom table? Or, am I best to use $wpdb->insert?
Thanks!