Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 826 through 840 (of 3,724 total)
  • Author
    Posts
  • in reply to: User custom fields not showing in author page #47417
    PeterPeter
    Moderator

    Hello,

    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/#twig

    It will look like

    {% for clone in ... %}
        {{ clone.instrument }}
    {% endfor %}
    in reply to: Using a Custom Taxonomy to Set Post Type #47416
    PeterPeter
    Moderator

    Hello 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/

    in reply to: image_advanced don't resize images like wordpress do. #47415
    PeterPeter
    Moderator

    Hello,

    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.

    in reply to: Custom function example #47407
    PeterPeter
    Moderator

    Hello,

    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.

    in reply to: Checkbox tree #47405
    PeterPeter
    Moderator

    Hello 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/

    in reply to: MB Frontend Submission stopped working in the latest weeks #47404
    PeterPeter
    Moderator

    Hello 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/

    in reply to: Best way to import into custom_html field #47403
    PeterPeter
    Moderator

    Simply, you can upload your site to a staging site and share the admin account. Then I can check what's wrong there. Thank you.

    in reply to: Repeatable blocks automatically add user in "user" field #47402
    PeterPeter
    Moderator

    Hello Oskar,

    This issue is still in progress. I will get back to you when it is fixed. Thank you.

    in reply to: Custom function example #47395
    PeterPeter
    Moderator

    Hello 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.

    in reply to: Remote Validation for Date Fields in Meta Box AIO #47394
    PeterPeter
    Moderator

    Hello 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.

    in reply to: New Customer - Installation Help #47393
    PeterPeter
    Moderator

    Hello 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.

    in reply to: How to order multiple custom field groups on settings page #47392
    PeterPeter
    Moderator

    Hello,

    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

    in reply to: clone_empty_start not working #47391
    PeterPeter
    Moderator

    The 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_start will work properly. The issue has been escalated to the development team, it will be fixed in the next update of our plugins.

    Thank you.

    in reply to: Best way to import into custom_html field #47388
    PeterPeter
    Moderator

    Hello,

    Please share your site admin account by submitting this contact form https://metabox.io/contact/
    I will take a look.

    in reply to: User custom fields not showing in author page #47387
    PeterPeter
    Moderator

    Hello,

    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.

Viewing 15 posts - 826 through 840 (of 3,724 total)