Forum Replies Created
-
AuthorPosts
-
March 18, 2023 at 3:59 PM in reply to: ✅Radio and Switch fields always reporting first choice value in Title Group #41081
Luca
ParticipantHello Peter,
I report that with
- MB Group 1.3.17 - 2023-02-08, or
- Meta Box AIO (1.19.0 - 2023-03-08)
the problem is fixed.
Fix incorrect group title with radio/checkbox/switch
Thanks
Luca
Participant+1 for me either
As noted above a link field would be very useful
January 30, 2023 at 7:50 PM in reply to: ℹ️Error add_action( 'rwmb_*****_before_save_post' does not work #40350Luca
ParticipantHi,
this didn't work for me either.After digging deeper into the problem, I noticed that the saved values are retrieved from the
RWMB_Requestobject and that this is not updated after calling the 'before_save_post' action.I have explicitly called the update of the Post values of the object calling the method
set_post_data()You could try and change your code as follows:
add_action( 'rwmb_m_contact_before_save_post', function() { $_POST['add_new_contact'] = 0; $_POST['test_field'] = 'test'; if ( function_exists( 'rwmb_request' ) ) { rwmb_request()->set_post_data( $_POST ); } } );
@justdoit123
Please, let me know if this corrects the problem on your side.
@Peter
Please, update the documentation or fix the problem, thanks.Luca
ParticipantHi Peter,
thanks for answer me.The code reported in my previous post was provided from the "Get PHP Code" of the Builder (Choices= 0:Hide
1:Show) and I agree it looks a bit messyI have tried with your modifications and still obtains same results (working nicely in settings page and not working in Customizer):
https://share.getcloudapp.com/QwujBKkG
I also noticed that by trying the Customizer repeatedly, sometimes it works correctly. But I have not found a consistent behavior.
I have used the following:
Clean WordPress installation (6.1.1),
Meta Box 5.6.15,
Meta Box AIO 1.17.0Theme: Twenty Twenty-Two
No other plugins
No Custom Fields via Builder
No Settings Pages via Builder
All MB available extensions activated
No console errorsSettings Page and Custom Fields created with the following code in functions.php:
add_filter( 'mb_settings_pages', 'lm_settings_page' ); function lm_settings_page( $settings_pages ) { $settings_pages[] = [ 'menu_title' => __( 'LM: Test', 'your-text-domain' ), 'id' => 'lm-settings-test', 'position' => 25, 'style' => 'boxes', 'columns' => 1, 'customizer' => true, 'icon_url' => 'dashicons-admin-generic', ]; return $settings_pages; } add_filter( 'rwmb_meta_boxes', 'lm_meta_boxes' ); function lm_meta_boxes( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'LM: Test 1', 'your-text-domain' ), 'id' => 'test-2', 'settings_pages' => ['lm-settings-test'], 'fields' => [ [ 'name' => __( 'Select', 'your-text-domain' ), 'id' => $prefix . 'select_test_1', 'type' => 'select', 'options' => [ 'a' => __( 'A', 'your-text-domain' ), 'b' => __( 'B', 'your-text-domain' ), 'c' => __( 'C', 'your-text-domain' ), ], ], [ 'name' => __( 'Text', 'your-text-domain' ), 'id' => $prefix . 'text_nhbsf837xqg', 'type' => 'text', 'visible' => [ 'when' => [['select_test_1', '=', 'b']], 'relation' => 'or', ], ], ] ]; return $meta_boxes; }I am glad to help investigate this problem.
Please, let me know.Luca
ParticipantHi,
I am having the same problem.The Conditional Logic is working in the Settings page, but it is not working in the Customizer.
Please, see the video:
https://share.getcloudapp.com/P8uNX1LkWith a clean WordPress installation (6.1.1),
Meta Box 5.6.15,
Meta Box AIO 1.17.0No other plugins
No other Custom Fields
No other Settings Pages
All available extensions activated
No console errorsCustom Fields created with MB Builder:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Test 1', 'your-text-domain' ), 'id' => 'test-1', 'settings_pages' => ['test'], 'fields' => [ [ 'name' => __( 'Select', 'your-text-domain' ), 'id' => $prefix . 'select_test_1', 'type' => 'select', 'options' => [__( 'Hide{/translate}', '{translate}Show', 'your-text-domain' )], ], [ 'name' => __( 'Text', 'your-text-domain' ), 'id' => $prefix . 'text_nhbsf837xqg', 'type' => 'text', 'visible' => [ 'when' => [['select_test_1', '=', 1]], 'relation' => 'or', ], ], ], ]; return $meta_boxes; }Thanks in advance
Luca
ParticipantThanks for the tip.
I would suggest to add a small tooltip to the "Save data in the raw format" checkbox available in the WYSIWYG field settings.
Thanks again.
Luca
ParticipantHi,
I was in the same situation and the linked article solved my problem too.
I think it would be very useful to have some kind of warning if the number of the submitted input vars exceed the PHP max_input_vars limit instead of the misleading "Field group updated" notification.
In my opinion it would be very useful also a "warning" remainder in the field group documentation.
Thanks
-
AuthorPosts