- This topic has 2 replies, 2 voices, and was last updated 5 months, 3 weeks ago by .
-
Topic
-
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!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.