Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterPlease try setting
query_varandpublicly_queryabletotrue.Anh Tran
KeymasterFYI, I fixed the bug in the version 2.0.5 of MB Frontend Submission.
Anh Tran
KeymasterHi Mary,
Sorry for the delay. I've looked at the
wp-cron.phpfile at line 111 and see it's a WordPress code that loops through a list of registered crons. The another line of errorwp_privacy_delete_old_export_filestells us this is a WP cron that delete old exported privacy files.All of that relates to the WP crons. I'll check your code in the email.
Anh Tran
KeymasterHi Will,
Your solution on sanitize callback is true. In Meta Box 5.1, we introduced the sanitization mechanism to make the data safe before saving into the DB.
For choice fields, the value stored is considered safe only if it's available in the field's options. In this case, the options is dynamically populated via Ajax, the sanitization will break.
One solution is bypass it at all, as you did. Another solution is write your own callback. Both should work well.
Anh Tran
KeymasterHi Manoj,
To update a cloneable group field, please use this snippet:
$values = []; $values[] = [ 'sub_field_1' => 'value1', 'sub_field_2' => 'value2' ]; // Value of clone 1 $values[] = [ 'sub_field_1' => 'value1', 'sub_field_2' => 'value2' ]; // Value of clone 2 update_post_meta( $post_id, 'group_id', $values );Anh Tran
KeymasterHi Tobias,
Here is a very detailed guide on this: https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
October 18, 2019 at 3:23 PM in reply to: ✅(Repeatable?) Block over certain content length crashes #16589Anh Tran
KeymasterHi Johannes, thanks for your feedback. The browser doesn't handle the GET request with long URL. I've fixed it in version 1.0.10.
October 18, 2019 at 2:48 PM in reply to: ✅Builder + Checkbox List + Select + User Meta + Edit Profile Form #16587Anh Tran
KeymasterHi Nick,
I set the
[OPERATOR]to=and[VALUE]topre_event(the value of the option is the value before:) and it works. Please see this video:October 18, 2019 at 2:35 PM in reply to: ✅Unsetting fields & changing placeholder/required before rendering form #16585Anh Tran
KeymasterHi @pza, I'm thinking about using some code like this:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $fields = []; if ( ! is_admin() ) { $fields[] = [...]; // A front-end-only field. } $text_field = [ 'id' => 't', 'name' => 'Text', ]; if ( ! is_admin() ) { $text_field['required'] = true; // Change field settings only on the front end. } $fields[] = $text_field; $meta_boxes[] = [ 'id' => 'custom-mb', 'title' => 'Custom Meta Box', 'fields' => $fields, ]; } );Anh Tran
KeymasterHi Sandra,
Can you provide more details on the problem? How did you setup the fields? Did you see any errors when enabling debug mode (or in the error log)?
Anh Tran
KeymasterHi,
I'm not quite clear about the question. Each post type registered with the plugin is a normal WordPress post type, which uses
single-{$post_type}.phptemplate file to display (and fallback tosingle.php. See WordPress docs for more details.The URL for each post in the post type is automatically generated if you set the permalink to something different than the default.
Anh Tran
KeymasterHi Kevin,
Thanks a lot for your help. I was able to fix this issue another way and just released the version 1.3.6 of the plugin. Meta Box AIO and MB Core will be released later today.
Anh Tran
KeymasterHi Tobias,
At the moment, the settings values are not sent to the REST API via MB REST API. You probably need to write your own route for that.
October 18, 2019 at 10:41 AM in reply to: ✅How can I use MB-Blocks as template registered post type? #16579Anh Tran
KeymasterI got it.
The custom blocks registered with MB Blocks have id
meta-box/{$block_id}. So you can define your post type template like:'template' => ['meta-box/hero', 'meta-box/team-member']Anh Tran
KeymasterHi, please see this video: https://www.loom.com/share/80fa3ff5dc6149a9bd2cb640a62aa69c. I demonstrate how to use
rwmb_meta,rwmb_the_valuein the block render callback.Just a note: when you use these helper functions, don't forget to use the parameter
$post_id. If you want to use other WordPress functions, remember to use it as well, or you'll get the wrong info when preview the block in the edit screen. -
AuthorPosts