Forum Replies Created
-
AuthorPosts
-
Peter
ModeratorHello,
You should use the helper function rwmb_meta() to get the group field value at once. To get the subfield value in a group, you can read more about using PHP code in the documentation https://docs.metabox.io/extensions/meta-box-group/#examples
then do the same with Twig code in the View template.
https://docs.metabox.io/extensions/mb-views/#twigIt will look like
{% for clone in ... %} {{ clone.instrument }} {% endfor %}Peter
ModeratorHello Rebecca,
I understand that you want to set the post type based on the select field after submitting the frontend submission form. I share with you an example of how to make it work:
1. I have a field group and a simple select field with the options is the CPT slug and label:
[ 'name' => __( 'Content type', 'your-text-domain' ), 'id' => 'content_type', 'type' => 'select', 'options' => [ 'book' => __( 'Book', 'your-text-domain' ), 'post' => __( 'Post', 'your-text-domain' ), 'page' => __( 'Page', 'your-text-domain' ), ], ],2. This field group is added to the frontend form.
3. I use this code to update the post type of the submitted post based on the select:
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) { if ( isset( $_POST['content_type'] ) ) { $post_type = $_POST['content_type']; $my_post = [ 'ID' => $post_id, 'post_type' => $post_type ]; wp_update_post( $my_post ); } }, 10, 2 );Refer to the documentation
https://docs.metabox.io/extensions/mb-frontend-submission/#form-hooks
https://developer.wordpress.org/reference/functions/wp_update_post/Note: this is an example. If it doesn't work or does not meet your requirements, you can contact us here to request a customization service https://metabox.io/contact/
January 15, 2025 at 8:47 PM in reply to: image_advanced don't resize images like wordpress do. #47415Peter
ModeratorHello,
Can you please tell me more about this state "I discovered than upload image using image_advanced don't resize pictures like WordPress do"?
The field image_advanced uses the WordPress media library popup and allows users to upload images on the site so WordPress also generates thumbnail images for the uploaded images as well. You can check the thumbnail images in the folder /wp-content/uploads/current-year/current-month folder.
Peter
ModeratorHello,
I add your code to the file functions.php in the theme folder, edit a post, add some sample value and save. The value is saved to the database properly, without any issues. Here is the screen record https://imgur.com/pMriFJ1
If it still doesn't work on your site, please share the site admin account by submitting this contact form https://metabox.io/contact/
I will take a look.Peter
ModeratorHello Tanja,
The child item is hidden by default and you need to check the parent item to show the child item. There isn't an option to show the child item as default. Please follow the documentation https://docs.metabox.io/custom-select-checkbox-tree/
January 14, 2025 at 10:45 PM in reply to: ✅MB Frontend Submission stopped working in the latest weeks #47404Peter
ModeratorHello Francesco,
Does it work if you use only Meta Box plugins and a WordPress theme? And please edit the post in the admin area to check if the subscriber is the author of the post. Also, let me know which versions of Meta Box plugins are on your site.
Following the documentation https://docs.metabox.io/extensions/mb-frontend-submission/
Peter
ModeratorSimply, you can upload your site to a staging site and share the admin account. Then I can check what's wrong there. Thank you.
January 14, 2025 at 10:03 PM in reply to: Repeatable blocks automatically add user in "user" field #47402Peter
ModeratorHello Oskar,
This issue is still in progress. I will get back to you when it is fixed. Thank you.
Peter
ModeratorHello Hazmi,
Can you please share the code that creates the custom fields "key_value" or "group"? If you use the builder, you can export the field group to a JSON file and share it here. I will help you check the issue.
Peter
ModeratorHello Simon,
Currently, the remote validation callback function only supports accessing one field value that you use the validation rule. It doesn't support accessing other field values in the callback function so you won't have value to compare dates like that.
If you want to compare 2 field values on live, you should create some custom Javascript code and validate the field value before saving it.Peter
ModeratorHello John,
Thank you for reaching out. You can download Meta Box from WordPress.org https://wordpress.org/plugins/meta-box/
it is a free and based plugin to run all Meta Box extension plugins, including MB AIO.January 13, 2025 at 11:05 PM in reply to: ✅How to order multiple custom field groups on settings page #47392Peter
ModeratorHello,
You can create/edit a settings page and create tabs on the settings page. Then create/edit the field group and select the tab on which the field group will show. Please check these screenshots https://imgur.com/a/UVNHHLN
Peter
ModeratorThe issue happens when the setting max number of clones set to 1 and if we set it to 2 or more, the setting
clone_empty_startwill work properly. The issue has been escalated to the development team, it will be fixed in the next update of our plugins.Thank you.
Peter
ModeratorHello,
Please share your site admin account by submitting this contact form https://metabox.io/contact/
I will take a look.Peter
ModeratorHello,
I change the code from
{% set user_id = mb.get_current_user_id() %}to
{% set user_id = mb.get_queried_object_id() %}to get the current query user ID and it shows the user (author) info correctly. Just a WordPress function to get the user ID, not an issue of MB Views or Meta Box.
-
AuthorPosts