Hi,
It's recommended to use a hook like 'plugins_loaded', 'init' or better - activation hook to create a new table. In case of a theme, you can hook into 'init', like this:
add_action( 'init', 'prefix_create_table' );
function prefix_create_table() {
if ( ! class_exists( 'MB_Custom_Table_API' ) ) {
return;
}
MB_Custom_Table_API::create( 'my_custom_table', array(
'address' => 'TEXT NOT NULL',
'phone' => 'TEXT NOT NULL',
'email' => 'TEXT NOT NULL',
), array( 'email' ) );
}
For more info, please see the sub-section E. in the section Notes of the documentation.