Hello
I created several custom blocks in WP Grid Builder to output values in cards the way I needed. It works fine except for number fields. For this field only the value of the first post is shown (same value in all posts).
See code:
add_filter( 'wp_grid_builder/blocks', 'go_register_wpgb_block_price' );
function go_render_wpgb_block_price() {
$object = wpgb_get_object();
if ( ! isset( $object->post_type ) ) {
return;
}
// price fields
$go_price = rwmb_meta( 'fg_sale_price', $object );
$go_price_info = rwmb_meta( 'fg_sale_info', '', $object );
$go_term_list = get_the_term_list( $object, 'status-sale' );
echo $go_price . ' ' . $go_price_info . ' ' . $go_term_list;
}
The one which is not working is $go_price. I know I should place an argument in the middle like for the other fields. But what to put? If I put '' no value will be retrieved, neither with 0, nothing works and in this documentation https://docs.metabox.io/fields/number I couldn't find anything which could help in this case.
Thanks in advance for a hint
Kind regards
François