Hello!
I've created a custom relationship between WooCoomerce products and pages:
add_action('mb_relationships_init', function() {
MB_Relationships_API::register(array(
'id' => 'gg_products_to_page',
'from' => 'product',
'to' => array(
'post_type' => 'page',
'field' => array(
'query_args' => array(
'post_parent' => (int) rwmb_meta('gg-packages-parent-page', array('object_type' => 'setting'), 'ggbox_settings')
),
'clone' => false
)
),
'reciprocal' => true
));
});
The problem: rwmb_meta in this hook always returns false. 🙁 How can I properly adjust the code to use a predefined setting variable in relationship settings? If I call the rwmb_meta() function elsewhere, it works and returns the currect setting value.
Thanks!