Xin Chao Long,
Actually, I am using the Meta Box UI to declare those :
https://share.cleanshot.com/W2CH8urnV772nFGLkt4F
This is the current code:
add_action( 'init', function() {
$table_name = 'websites';
$post_id = 532; // test on a specific post
// we get the monthly credit
$time_credit_monthly = rwmb_get_value( 'time_credit_monthly', [
'storage_type' => 'custom_table',
'table' => $table_name],
$post_id );
// we reset the quota with the monthly credit
$field_id = 'time_credit_left';
$value = $time_credit_monthly;
rwmb_set_meta( $post_id, $field_id, $value, [
'storage_type' => 'custom_table',
'table' => $table_name,
] );
}, 99 );
Thanks again for your help.
In the same time I will have a look at the Custom Table API.