Forum Replies Created
-
AuthorPosts
-
March 12, 2019 at 10:15 AM in reply to: question about coping code over to new site with only free metabox plugin #13674
Anh Tran
KeymasterHi Brian,
Thanks a lot for your feedback about the Template extension. It was a typo mistake (duplicated "Version" text).
I've fixed and updated Meta Box AIO. Please update.
Anh Tran
KeymasterHi Toomas, sorry for the confusion.
Where do I need to put this code exactly?
Please put them directly below your code to register meta box. Or in the theme's
functions.phpfile.What “location” in your code means? “Taxonomy_2” is the name of a custom taxonomy field?
I should have mentioned you need to change the "location" to the name of the custom post type created by CPT-Onomies plugin (in your case, it's "books") and "taxonomy_2" - the ID of the taxonomy field (in your case, it's still "taxonomy_2").
Please try again and see if it works.
Anh Tran
KeymasterHi Ryan,
I thought I fixed this bug in the BB Integrator extension. Can you try the individual plugin (not in the AIO package)?
Anh Tran
KeymasterTo me, it's more likely a bug. Since it still checks for the selector of dependent element. I'll check and fix that.
Anh Tran
KeymasterHi Ryan,
I've tested your code and found that the
$metaneeds to be an array. So you just need to change the line to:$meta = array_filter( array_unique( (array) $current_users_tags ) );I also created a video to demo that: http://recordit.co/AcdsXqaeIM. Please take a look.
March 11, 2019 at 10:48 AM in reply to: ✅Relationship 'Post' edit screen even if 'post_type' => 'product' only #13650Anh Tran
KeymasterHi Matthias,
Did you activate the MB Term Meta extension? It's required to set relationships with terms.
Anh Tran
KeymasterI got it. I've looked at the CPT-Onomies plugin and found a solution for that. Please paste the following code into your theme/plugin:
add_action( 'save_post', function( $post_id ) { prefix_save_custom_tax( $post_id, 'location', 'taxonomy_2' ); }, 20 ); function prefix_save_custom_tax( $post_id, $taxonomy, $field_id ) { global $cpt_onomies_manager, $cpt_onomy; // Make sure its a valid CPT-onomy. if ( ! $cpt_onomies_manager->is_registered_cpt_onomy( $taxonomy ) ) { return; } $new = isset( $_POST[ $field_id ] ) ? $_POST[ $field_id ] : array(); $new = array_unique( array_map( 'intval', (array) $new ) ); $new = empty( $new ) ? null : $new; // Set the terms. $cpt_onomy->wp_set_object_terms( $post_id, $new, $taxonomy ); }Note that I separated the function that save terms, so you can call it multiple times for different taxonomy field.
I hope that works for you. Please let me know after you tested it.
March 11, 2019 at 9:39 AM in reply to: ✅Problem retrieving image data using image_upload meta field in while loop #13648Anh Tran
KeymasterHello,
Can you check if you passed the correct post ID? This is the only thing that I guess caused the bug.
March 11, 2019 at 9:36 AM in reply to: question about coping code over to new site with only free metabox plugin #13647Anh Tran
KeymasterHi Brian,
You still need the premium plugins activated on the website to make the code work. The generated code is the work you want the plugins to do for you. And the whole process behind needs the premium plugins. If you want to keep the plugin list short, you can use the Meta Box AIO plugin. It has all free and premium plugins inside.
Anh Tran
KeymasterHi Charlin,
The problem is when the group is cloneable, the conditions is "scoped" inside the clone only. Think about a situation when you have a group of 2 fields A and B. B is visible when A has a value "a".
What about if we clone this group and have multiple pairs (A,B). A1 has a value "a", then all B will be visible without scoping, which is weird.
I'll try to think about your situation and provide an update for this specific case.
Anh Tran
KeymasterI think the problem is calling
get_current_user_idtoo early. This docs page has an interesting comment:Before the plugins_loaded action it returns 0.
So you might want to make some change to:
add_action( 'init', function() { add_filter( 'rwmb_meta_boxes', 'your_register_function' ); } );March 10, 2019 at 8:05 AM in reply to: ✅Relationship 'Post' edit screen even if 'post_type' => 'product' only #13634Anh Tran
KeymasterHi guys,
I guess this problem occur because the MB User Meta plugin is not active. It's required to make relationship from "user". Can you please check that?
Anh Tran
KeymasterHi Matthias, sorry I was looking to solve Ale's problem. Let me check with the group state.
Anh Tran
KeymasterHi Toomas,
Sorry for the problem. I'm happy to send you the refund. However, can you please give me a few days to check the incompatibility with CPT-onomies plugin and probably provide a fix for that?
Also, would you please give the name of the plugin that has conflict with CPT-onomies? Since you bought a bundle, there are 12 plugins in there.
Another thing, I think CPT-onomies is used for creating relationships between objects. So, why don't you use MB Relationships instead?
Thanks
AnhAnh Tran
KeymasterI'm still investigating in the bug. Will try my best to fix it earlier next week.
-
AuthorPosts