Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Sam,
Did you create the custom table with code? The MB Custom Table doesn't create the table automatically. Instead, you need to put a small snippet into your theme's
functions.phpfile to create a table manually. Here is the guide on doing that.If you already did that but no tables are created, please check if your database user has privileges to create new tables. Some hosts don't allow you to do that.
Regarding issue with displaying fields on the front end, are the fields just normal custom fields or they're fields used with custom table? As there is still a problem with custom table, the custom fields don't work properly until we resolve it.
I'll answer your question about MB Relationships in another topic of yours.
Anh Tran
KeymasterHi Mark,
The shortcode in BB is a wrapper version of rwmb_the_value() helper function. For terms, it returns a link to that term. And there's no extra arguments at the moment. We'll try to improve that later. It's might be a nice improvement for not only terms, but also posts, users, images.
@Sam: I'll answer you in your topics.
Anh Tran
KeymasterHi Sam,
Thanks for your feedback. I'll check and fix that.
Anh Tran
KeymasterBoth rwmb_* functions and WordPress's get_post_meta() don't use JSON at all. They use serialize for arrays. Maybe you need to check how data is saved in your case, just to make sure it's valid. Anyway, as the data is there, you can use json_decode function to decode it.
January 18, 2019 at 4:24 PM in reply to: ✅Set default value to field if this value still not exist #13053Anh Tran
KeymasterHi Jefferson,
You can use
stdattribute for a text field, like this:$post_id = isset( $_GET['post'] ) ? intval( $_GET['post'] ) : ( isset( $_POST['post_ID'] ) : intval( $_POST['post_ID'] ) : false ); $meta_boxes[] = [ 'fields' => [ [ 'type' => 'text', 'id' => 'color', 'std' => generate_my_own_code( $post_id ), ], ], ];Anh Tran
KeymasterYes, I think so. Not sure where it comes from, since Meta Box doesn't use JSON at all.
Anh Tran
KeymasterHi Max,
Querying posts using relationship as a condition is not supported. You might want to query posts as usual, then perform an API call to get connected items for each post. Then you can use condition to decide whether to show them.
MB_Relationships_API::each_connected( array( 'id' => 'posts_to_pages', 'from' => $wp_query->posts, // 'from' or 'to'. ) ); while ( have_posts() ) : the_post(); // Skip if no connected posts. if ( empty( $post->connected ) ) { continue; } // Output here endwhile;Anh Tran
KeymasterHi Max,
I think the problem is there are multiple meta boxes and the hooks don't fire properly. They fire per meta box, so if there are 2 meta boxes, the hook
rwmb_before_save_postmight fire before one meta box saving action, but after another meta box saving action.As Meta Box uses hook
save_post_{$post_type}with priority to save the data, please try the replacing the hooks with:add_action('save_post_{your_post_type}', 'api_get_old_fields', 0); add_action('save_post_{your_post_type}', 'api_set_new_fields', 20);Anh Tran
KeymasterHi Scott,
It's so sad to see you go. Hopefully you'll come back later. I've issued the refund.
Best regards
January 14, 2019 at 10:18 AM in reply to: ✅Select elements with long titles from relationship boxes break out of meta box #13022Anh Tran
KeymasterHi Doug, thanks for your help. It's added to the plugin.
Anh Tran
KeymasterHi, can you clearing the browser cache and try again with the latest file from Github? The fix requires new JS file, which needs to clear browser cache.
Anh Tran
KeymasterThanks for notifying us. Let's continue the discussion in the previous topic since it has details.
Anh Tran
KeymasterThanks a lot for your feedback. I forgot to update the version number in the PHP file. Please try to update again!
January 11, 2019 at 10:40 AM in reply to: ✅Filter mb_aoi_extensions fails unless at least one item checked in "All-In-One" #12983Anh Tran
KeymasterHi criv23,
In the callback filter
mb_aio_extension, can you change the code toreturn $extensionsinstead of$optionand see if it works?Anh Tran
KeymasterHi Christine,
Sorry for this issue. Zeeshan just left our support team, so I'll continue support you on this. I think the error in the console is not the cause of the bug since it's only the
mapfile. Can you please take a screenshot of the MB Builder screen? And if possible, please send me a temporary admin account via contact form, so I can do some debug on your site.Thanks.
-
AuthorPosts