I'm trying to create a custom meta table, that uses the functionality already written into WP.
function get_mytype_meta( $post_id, $key = '', $single = false ) {
return get_metadata( 'mytype', $post_id, $key, $single );
}
function add_mytype_meta( $sid, $meta_key, $meta_value, $unique = false ) {
return add_metadata( 'mytype', $sid, $meta_key, $meta_value, $unique );
}
function update_mytype_meta( $sid, $meta_key, $meta_value, $prev_value = '' ) {
return update_metadata( 'mytype', $sid, $meta_key, $meta_value, $prev_value );
}
What is stopping this from working so far, is the function _get_meta_table which then requires the table {wpdb->prefix}mytypemeta to be listed in $wpdb already. I'm not sure where to do that.
Please advise. Greatly appreciated!