Forum Replies Created
-
AuthorPosts
-
May 18, 2017 at 8:12 AM in reply to: How to display select_advanced, for each > select > option in frontend #5884
Anh Tran
KeymasterHi Daniel,
There's a documentation on displaying checkbox_list, radio, select value in the frontend.
However, if you are looking for a way to show options that users can select, I'm afraid you need to write the code yourself. It looks similar to this:
$options = array( 'country-us' => 'United States', 'country-uk' => 'United Kingdom' ); echo '<select name="your_name">'; foreach ( $options as $value => $label ) { echo '<option value="' . $value . '">' . $label . '</option>'; } echo '</select>';Anh Tran
KeymasterHi @asifsk,
As we see here the data is saved correctly in JSON, that means the Group extension works well. The problem is how the plugin "CSV Import Suite" does the import. As the data has no problem, the bug happens only when importing, and the import plugin is the only one that does this part.
Can you please ask WooCommerce team for help on this?
Anh Tran
KeymasterThanks, I will check that ๐
Anh Tran
KeymasterYes, the
add_buttonis just added recently to help you change the button text quickly. Glad that you found it ๐Anh Tran
KeymasterLooks like your code is duplicated somehow, please try:
add_action( 'rwmb_meta_boxes', 'course_register_meta_boxes' ); function course_register_meta_boxes( $meta_boxes ){ $meta_boxes[] = ... return $meta_boxes; }Also, please check if that code is loaded before
inithook.Anh Tran
KeymasterThanks for reporting. I will fix it soon.
May 13, 2017 at 2:31 PM in reply to: [MB Frontend Submission] Multiple IDs in one form, possible? #5850Anh Tran
KeymasterIf you want to insert values for
checkbox_list, you should insert each value in 1 meta, like this:add_post_meta( $post_id, $key, 1, false ); add_post_meta( $post_id, $key, 2, false );Note to set the last parameter
false. It makes we can insert multiple values in multiple rows for the post.May 12, 2017 at 10:03 AM in reply to: [MB Frontend Submission] Validation in frontend is not working #5844Anh Tran
KeymasterHi patte,
This is the bug in the Meta Box plugin as its code works only in the backend. I've just pushed a fix on Github. Will update the plugin soon.
May 12, 2017 at 9:38 AM in reply to: Lots of images in an image_advanced can wipe all images in that field on save #5843Anh Tran
KeymasterUnfortunately, we haven't get a solution for it now. The speed of JS is still a problem.
Anh Tran
KeymasterHi Matt,
The problem is previously you might use this code to register meta boxes:
add_action( 'admin_init', 'prefix_register' ); function prefix_register() { // Some code here }Or something like this:
if ( is_admin() ) { add_action( 'rwmb_meta_boxes', 'prefix_register' ); function prefix_register( $meta_boxes ) { // Some code here } }It's required to switch to simpler syntax like this:
add_action( 'rwmb_meta_boxes', 'prefix_register' ); function prefix_register( $meta_boxes ) { // Some code here }in order to make the
rwmb_metawork.Anh Tran
KeymasterHi Hazmi, sorry for late reply. Can you post your code here?
May 12, 2017 at 9:31 AM in reply to: [MB Frontend Submission] Multiple IDs in one form, possible? #5840Anh Tran
KeymasterWhy do you need 4 meta boxes / forms? Is it just easier to create 1 meta box / form with all the fields? You can use the
heading,dividerfields to keep them separated. Or usecustom_htmlfield to insert custom HTML between them.I think it's better than creating 4 forms (and the shortcode can't handle multiple IDs at the moment).
May 12, 2017 at 9:24 AM in reply to: [MB Frontend Submission] How to edit post in the frontend? #5839Anh Tran
KeymasterDo you mean after submitting the new post, show that post for user to keep editing?
In that case, I'd suggest you create a new shortcode, paste it into new page and redirect it. Here is the code I'm thinking about:
add_action( 'rwmb_frontend_after_save_post', 'prefix_redirect' ); function prefix_redirect() { wp_safe_redirect( home_url( '/page-2/' ) ); }Anh Tran
KeymasterHi Hazmi, there's a bug of cloning wysiwyg inside a multi-level nested groups. I'm working on it and will update the plugin as soon as it's fixed.
Anh Tran
KeymasterHi,
All the options (parent or children) are treated equally. And you have to select individual items so save the value. So if you select the parent element, it doesn't auto select all of its children. You still need to manually check each of them. This way you can select only some of them, not all nor none.
In case you want to toggle all the selection, you can add a parameter
'select_all_none' => true. However, it works with all options.To populate the value before it's saved, you can use the filter
rwmb_{$field_id}_value.Hope that helps.
-
AuthorPosts