Forum Replies Created
-
AuthorPosts
-
September 18, 2015 at 10:43 AM in reply to: WSYIWYG seems to be broken when using groups - sorry to reopen #1460
Anh Tran
KeymasterGreat, I just got the email. We'll talk in email for details ๐
Anh Tran
KeymasterHi Sam,
I tested your code and tried to replicate the bug. After testing, I found that this bug was reported in this topic before. It was also reported on Github and was fixed.
I've just released the new version of Meta Box (4.5.7) which has a fix for this. The new version works fine to me. Please update Meta Box plugin and let us know if it works for you.
Thanks.
Anh Tran
KeymasterGlad that you've solved your problem ๐
Anh Tran
KeymasterI think that works, too. I will add this question to the Documentation as this is maybe useful for others as well.
September 14, 2015 at 12:27 PM in reply to: Conditional Logic Between Checklist Group and Checkbox #1438Anh Tran
KeymasterHi Justin,
Thanks again for contacting us, I've checked your registered code and see that's a bug and we'll list in in our documentation shortly.
That bug happen when you define two field with similar ID, for example, 'hello' and 'hello_foo' or 'hello*' (* matches any characters)
To workaround, you can update:
'id' => $prefix . $slug . '_categories',To
'id' => $prefix . 'categories_' . $slug,Best regards
Tan Nguyen
Anh Tran
KeymasterHi again, I've just updated the Updater extension today with a fix for PHP notice bugs which I think caused the issue of wrong number of updates. I tested in my environments and it worked correctly. Can you please update and check that?
Thanks!
Anh Tran
KeymasterHi mendio,
Yes, you can do that using the
rwmb_{$field_id}_valueandrwmb_{$field_id}_metafilters (see this documentation) to change the displayed value and saved value. Here is the sample code:add_filter( 'rwmb_ID_value', function( $value ) { return date( 'Y-m-d', strtotime( $value ) ); } ); add_filter( 'rwmb_ID_meta', function( $value ) { return date( 'd-m-Y', strtotime( $value ) ); } );Don't forget to change
IDto your field ID.September 13, 2015 at 11:13 PM in reply to: WSYIWYG seems to be broken when using groups - sorry to reopen #1434Anh Tran
KeymasterI received your email and replied. Please look at the email.
Anh Tran
KeymasterHi Cararina,
Sorry for long response, we're still in progress to improving Conditional Logic. As this plugin uses Javascript to handle visibility of object and have to check many field conditional to generate results so it's hard to implements now. In your case, we'll have two ways to make it works natively:
1. Save it as
cel_product_apple,cel_product_androidorcel_product_windowsphonein DB then usefone_idto check what's field to output.2. Save
cel_product_apple,cel_product_androidorcel_product_windowsphonein DB, then create another hidden field namedcel_product, when post is saved, we also save the visible field tocel_productas an serialized array, then useunserializefunction to show up.Example (2),
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = array( 'id' => 'brand_product', 'title' => 'Brands and Products', 'post_types' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'id' => 'fone_id', 'name' => 'Brand', 'desc' => 'Pick Your Favourite Brand', 'type' => 'select', 'options' => array( 'apple' => 'Apple', 'android' => 'Android', 'windowsphone' => 'WindowsPhone' ) ), array( 'id' => 'cel_product', 'type' => 'hidden', ), array( 'id' => 'cel_product_apple', 'name' => 'Select your apple product?', 'type' => 'checkbox_list', 'options' => array('iPhone', 'iPad', 'iPod'), 'visible' => array( 'fone_id', 'apple' ) ), array( 'id' => 'cel_product_android', 'name' => 'Select your android product?', 'type' => 'checkbox_list', 'options' => array('Galaxy', 'ZenPhone', 'Tablet'), 'visible' => array( 'fone_id', 'android' ) ), array( 'id' => 'cel_product_windowsphone', 'name' => 'Select your apple product?', 'type' => 'checkbox_list', 'options' => array( 'Nokia', 'Galaxy' ), 'visible' => array( 'fone_id', 'windowsphone' ) ) ) ); return $meta_boxes; } ); add_action('rwmb_before_save_post', function($post_id) { // Get person ID to save from "Select a Customer" field $metabox_to_save = $_POST['fone_id']; // Save related field to phone field if ( ! empty( $_POST["cel_product_{$metabox_to_save}"] ) ) $_POST['cel_product'] = serialize( $_POST["cel_product_{$metabox_to_save}"] ); // Clear all hidden meta boxes foreach ( array('apple', 'android', 'windowsphone') as $field ) { if ( $field !== $metabox_to_save ) unset( $_POST["cel_product_{$field}"] ); } } );To retrieve values in front end, just use:
$cel_products = unserialize( rwmb_meta('cel_product') );Best regards
Tan Nguyen
Anh Tran
KeymasterThanks Sam very much for reporting this bug, we're working and release the patch for Group shortly ๐
September 11, 2015 at 1:45 PM in reply to: Conditional Logic Between Checklist Group and Checkbox #1420Anh Tran
KeymasterDear Justin,
I've checked with and it works, can you please tell me what's version you're using and provide your code to register meta boxes and define conditional logic?
Here's my snippet for example:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = array( 'id' => 'brand_product', 'title' => 'Brands and Products', 'post_types' => array( 'post', 'page' ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'id' => 'show_checkboxlist', 'name' => 'Show Checkbox List', 'desc' => 'Show Checkbox List when this checkbox is checked', 'type' => 'checkbox' ), array( 'id' => 'brand', 'name' => 'Brand', 'desc' => 'Pick Your Favourite Brand', 'type' => 'checkbox_list', 'options' => array( 'Apple' => 'Apple', 'Google' => 'Google', 'Microsoft' => 'Microsoft' ), 'visible' => array('show_checkboxlist', true) ) ) ); return $meta_boxes; } );Best regards
Tan
September 11, 2015 at 1:34 PM in reply to: Conditional Logic Between Checklist Group and Checkbox #1419Anh Tran
KeymasterHi Justin, sorry for long silence, I'm checking this issue and give you an answer shortly ๐
Anh Tran
KeymasterGlad to hear it's fixed!
Thanks for using Meta Box.
September 10, 2015 at 10:46 AM in reply to: Radio buttons not rendering/their value isn't recorded #1409Anh Tran
KeymasterThis is weird, please send me info (same as in the another ticket) so I can look into it for you.
September 10, 2015 at 10:45 AM in reply to: WSYIWYG seems to be broken when using groups - sorry to reopen #1408Anh Tran
KeymasterHi, please send me info in the Contact page. I will look at the issue for you ๐
-
AuthorPosts