Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 3,958 total)
  • Author
    Posts
  • in reply to: Use MB User Meta data in meta box #14150
    Anh TranAnh Tran
    Keymaster

    Hi,

    Now I got it!

    Do you have a field for user to select a product that associated with that user? I didn't see you mentioned about it above.

    If you already have that, assuming the field ID is ag_product, then you need to modify the rest response to include product details. Here is a sample code that you can use (put it in your theme's functions.php file or your plugin file):

    add_action( 'rest_api_init', function () {
        register_rest_field( 'user', 'to_quantity', array(
            'get_callback' => function( $user ) {
                $product = get_user_meta( $user['id'], 'ag_product', true );
                return get_post_meta( $product, 'to_quantity', true );
            },
        ) );
        register_rest_field( 'user', 'to_description', array(
            'get_callback' => function( $user ) {
                $product = get_user_meta( $user['id'], 'ag_product', true );
                return get_post_meta( $product, 'to_description', true );
            },
        ) );
        register_rest_field( 'user', 'to_advantages', array(
            'get_callback' => function( $user ) {
                $product = get_user_meta( $user['id'], 'ag_product', true );
                return get_post_meta( $product, 'to_advantages', true );
            },
        ) );
    } );
    in reply to: Big security issue ... #14149
    Anh TranAnh Tran
    Keymaster

    Hi Virgile, thanks a lot for your feedback. I'll check and fix the plugin asap!

    To be honest, security is not my strength and I'm still improving it. Thanks for your help!

    in reply to: Group not working properly #14144
    Anh TranAnh Tran
    Keymaster

    Unfortunately, not. It should be consistent with other cloenable fields.

    in reply to: Group not working properly #14142
    Anh TranAnh Tran
    Keymaster

    Have you tried clearing browser cache? It’s an update of JS and requires to clear cache!

    Regarding the removal, when there is one instance, the remove link/button won’t show. It’s for you to enter data.

    in reply to: Front end comment form fields #14140
    Anh TranAnh Tran
    Keymaster

    Hi Christopher,

    We have that on the plan but it's not a priority at the moment. Sorry, but I don't have ETA for this feature.

    in reply to: Duplicate form submissions #14138
    Anh TranAnh Tran
    Keymaster

    Hi Ryan, I've just fixed this bug and sent you a copy via email. Please try it and let me know the result.

    Anh TranAnh Tran
    Keymaster

    Hi Sam,

    Showing group in a page builder is not supported yet. We're figuring it out the best way to do that.

    The only way to do it now is via custom code. And please follow this docs:

    https://docs.metabox.io/extensions/meta-box-group/#getting-sub-field-value

    The group value is an array of sub-fields' values. So you need to extract them from the outer array. Let me know if you need any help.

    in reply to: Posts not searchable #14135
    Anh TranAnh Tran
    Keymaster

    Hi, thanks a lot for your feedback. I've just fixed and released a new version. Please update.

    in reply to: Can't make WordPress save in custom table #14134
    Anh TranAnh Tran
    Keymaster

    Hi kesit,

    Please make sure all field IDs match the table columns. I see at lease konsumen_id field doesn't have a column in the table.

    in reply to: Group not working properly #14133
    Anh TranAnh Tran
    Keymaster

    Hi Matthias,

    Looks like we fixed only for the non-clonable groups. Let me check and fix for cloneable groups.

    Update: I've just fixed this bug and release version 1.3.3. Please update.

    Anh TranAnh Tran
    Keymaster

    Ah, I got it. That's what we plan to do this year!

    in reply to: build custom meta boxes for soccer matches #14100
    Anh TranAnh Tran
    Keymaster

    Hi Sadiq,

    Please try to follow these steps:

    1. Create a new custom post type for teams, you can use MB Custom Post Type to do this.
    2. Create a meta box like this:
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        $meta_boxes[] = [
            'title' => 'Matches',
            'fields' => [
                [
                    'id' => 'matches',
                    'type' => 'group',
                    'clone' => true,
                    'collapsible' => true,
                    'fields' => [
                        [
                            'id' => 'league',
                            'name' => 'League',
                            'type' => 'text',
                        ],
                        [
                            'id' => 'team1',
                            'name' => 'Team 1',
                            'type' => 'post',
                            'post_type' => 'team',
                        ],
                        [
    
                            'id' => 'team2',
                            'name' => 'Team 2',
                            'type' => 'post',
                            'post_type' => 'team',
                        ],
                    ],
                ],
            ],
        ];
    } );

    PS: Please take the code as a starter point and try to follow the docs for Meta Box and MB Group. As you're the one who knows what you want exactly, you should do the code. I can just only help, but can't do that for you.

    Anh TranAnh Tran
    Keymaster

    Hi,

    Gutenberg removed the hook for meta boxes after title, and there's no way to do that. The WP team said that they will turn the post title into a block itself, so there's no fixed position.

    It would be nice to have a MB Block (reusable?) selectable or a separate one for each MB Group/Field one could place in the Block column so you could edit in full width.

    Can you explain this? I'm not sure I got it.

    in reply to: Duplicate form submissions #14092
    Anh TranAnh Tran
    Keymaster

    Hi Ryan, I think the validate method works only once, e.g. if you implement a validation on the form, then Meta Box's validation won't work.

    A simple workaround is copying the code from validate.js to your file.

    Probably I'll make this feature in the next version. Letting you or other developers doing this seems a little bit confusing.

    in reply to: build custom meta boxes for soccer matches #14091
    Anh TranAnh Tran
    Keymaster

    Hi Sadiq,

    Regarding the first question, I think you can do that with MB Group. You can create a repeatable group with fields: league, team 1, team 2, etc.

    Regarding the 2nd question, yes, you can get field value with helper functions or shortcode.

Viewing 15 posts - 1,231 through 1,245 (of 3,958 total)