Support MB Custom Post Type Display CPT in page Reply To: Display CPT in page

#11637
Anh TranAnh Tran
Keymaster

I see, it's much clearer now.

To get the field values from your table CPT, please pass the post ID (value of the field pricing_table_id) to the 3rd parameter of rwmb_meta function. Here is a modified version of your initial code:

$table = isset( $pricing['pricing_table_id'] ) ? $pricing['pricing_table_id'] : '';
if ( $table ) {
  $plans = rwmb_meta( 'plan', '', $table ); // THIS
  if ( ! empty( $plans ) ) {
    foreach ($plans as $plan) {
      $name = isset( $plan['plan_name'] ) ? $plan['plan_name'] : '';
      echo $name;
    }
  }
}