Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi David, can you post the code that register meta boxes with columns? So I can debug it?
June 5, 2018 at 9:14 PM in reply to: How to autopublish post entered thru Frontend Submission with all the fields? #10054Anh Tran
KeymasterHello, the last question can be done with
the_contentfilter. Please see the docs and example here.Anh Tran
KeymasterHi Calpaq, I got it. I think in this case, it's better to use some conditional check in your template. Something like this:
if ( your_is_cart_empty() ) { echo 'Please go back and add some items'; } else { echo do_shortcode( '[mb_frontend_form id="meta-box-id"]' ); }It's much easier than filter the form or change the fields inside.
Anh Tran
KeymasterVery nice snippet, David. I've added it to the Library on Github :).
June 5, 2018 at 11:52 AM in reply to: if i add 0 value for select filed code not exporting values #10040Anh Tran
KeymasterHello,
My developer is still working on this bug. Looks like the Builder extension doesn't export the value correctly. We'll let you know when it's fixed.
June 5, 2018 at 11:50 AM in reply to: ✅Migrating custom fields data between Custom Post Types and Taxonomies #10039Anh Tran
KeymasterHi,
I'm quite confused about the slug. WordPress doesn't use it to store custom fields for posts. WordPress use a combination of (post ID, meta key, meta value) in the DB. That's the post ID that Meta Box is using.
Anyway, if there's anything involved with "slug", then it's not supported by Meta Box :(. So a custom migration script is required, I guess.
Anh Tran
KeymasterHi Ahmed,
To use the MB Comment Meta, all you need to do is replacing
post_typesrule in Meta Box by'type' => 'comment'. That's just simple.Anyway, comment is a special content type in WordPress and it uses a totally different API to save content. Unlike posts and custom post types, the content for comments is different. So I'm afraid the MB Frontend Submission can't work in this situation.
Anh
Anh Tran
KeymasterHi David,
Yes, that's the normal behaviour. When you define a group, its sub-fields won't have a separated values in the database. Instead their value is stored inside the top-level group. So, you need to get the single value for the top-level group, and you'll get an array of all sub-fields values. Then you can parse this array to show whatever you want.
June 4, 2018 at 9:40 PM in reply to: How to display an image in frontend with link for full size? #10025Anh Tran
KeymasterHi,
To display the images in thumbnail with links to the full-size, please use this shortcode:
[rwmb_meta meta_key="field-id" link="true" size="thumbnail"]You can also use code snippet, if you don't want to use shortcode:
$images = rwmb_meta( 'field-id', array( 'size' => 'thumbnail' ) ); foreach ( $images as $image ) { echo '<a href="', $image['full_url'], '"><img src="', $image['url'], '"></a>'; }For more info, please check out the docs.
Anh Tran
KeymasterIf you're going to use cloneable groups, then the data is always saved as serialized arrays. The flat table is compatible for only non-cloneable fields.
Anh Tran
KeymasterHi Calpaq,
Let me try to understand your problem. Are you trying to put a frontend form in the Cart page? And if there's no products in the cart, you'd want to show a message to users. Otherwise, they need to fill in all the form fields so they can see the Submit button? Am I right?
Anh Tran
KeymasterHi Dave,
There are several solutions for that, please check these links:
https://wordpress.org/plugins/view-own-posts-media-only/
https://wordpress.stackexchange.com/q/1482/2051Anh Tran
KeymasterHi Mauro,
Thanks a lot for your bugs. I've just fixed those typos in the
composer.jsonfile, and remove the updater, cause it does nothing. The update is controlled by Composer in this case.May I suggest in the future to standardise all the naming of both directories and plug-in init files to one naming convention — be it mb-[plugin name] or meta-box-[plugin name] ?
Yes, it should be
mb-[plugin name]. I'll remember that.Another note: many plug-ins have the .svn directory inside, is this the intended behaviour? Shouldn’t all version control information be removed during the install of the components?
It's the default behaviour of the WPackagist. I found a way to fix this. Please check it out.
June 4, 2018 at 8:19 PM in reply to: Suggestion: Add Topics Started link to right-hand side menu in Support Forums #10019Anh Tran
KeymasterYes, only admins can mark topics as resolved :). I'll do it now.
Anh Tran
KeymasterHaha, Thomas, thanks!
I had a snippet on the Meta Box Library that shows a meta box for all custom post types. Please check it out!
-
AuthorPosts