I am using the rwmb_meta_boxes filter hook to create metaboxes.
But, I can't seem to get the value of a field from the post and use it in the metabox while inside that filter:
I am getting the id of the post like this:
$post_id = filter_input( INPUT_GET, 'post', FILTER_VALIDATE_INT );
Then I am trying to retrieve a value from the post:
$value= (int) get_post_meta( $post_id, 'my_value_field', true );
Finally, I'm trying to use it as part a field defined in the metabox. But the value is always blank.
Echoing out the value shows that the filter seems to be invoked multiple times but only once does it get the proper value but that instance is never the last time the filter is invoked.
So how can I get a metavalue from the post and use it in the metabox (something as simple as echoing out the value to the metabox as a custom html for example). I feel like I am missing something pretty simple here.
Thanks!