Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,551 through 2,565 (of 3,958 total)
  • Author
    Posts
  • in reply to: User registration #7814
    Anh TranAnh Tran
    Keymaster

    Hi David,

    The long term for MB Frontend Submission is making it works with any kind of object and any kind of data storage. Your proposal is a nice trick. I will try to implement it and see how it works ๐Ÿ™‚

    in reply to: โœ…Add clone id #7813
    Anh TranAnh Tran
    Keymaster

    I partly understand :).

    The logic behind saving state for collapsible groups is quite simple that you can do similarly. Just add a hidden field to the group and use the CSS class to access to that field to set/change value. Because it's an actual field, the value will be saved when the group is saved.

    Hope that helps!

    in reply to: About Group Items #7812
    Anh TranAnh Tran
    Keymaster

    Hi,

    Yes, it's possible.

    The collapsible groups have collapsed / expanded state. You can set the default state via 'default_state' => 'collapsed' and make the group saves its state with 'save_sate' => true.

    in reply to: STD with Clone Feature #7811
    Anh TranAnh Tran
    Keymaster

    Hi,

    Please just add a setting 'clone_default' => true to fields if you want them to have 'std' value when cloning. If you clone a group and want to keep 'std' value for sub fields, please add that setting to all sub field.

    in reply to: Request: Background Field #7810
    Anh TranAnh Tran
    Keymaster

    Hi,

    No problem. We're working on this.

    in reply to: Post relationships #7806
    Anh TranAnh Tran
    Keymaster

    Hi David,

    Thanks a lot for your reply. I've looked at the database structure of Posts2Posts and it's quite similar to your 2nd table structure. I will try to implement this feature as soon as I can.

    Thanks,
    Anh

    in reply to: Post relationships #7796
    Anh TranAnh Tran
    Keymaster

    Hi David,

    Thanks a lot for your examples. That makes the picture a lot clearer. I will read more about this (probably Posts 2 Posts is the best one in WP ecosystem, right?). In the mean time, would you mind sharing how you have implemented a solution before?

    in reply to: Post relationships #7788
    Anh TranAnh Tran
    Keymaster

    Hi David,

    Thanks for a great question.

    Currently, the way Meta Box and extensions work are one-way relationship. You can use a field "post" to attach 1 or many posts to a post. That's similar to 1-1 and 1-many relationship, but just one way.

    The MB Custom Table does the storing job only. So if you create a custom table with 2 columns ID and related_posts, you can store related posts for a single post. And you can query the related posts via helper functions.

    I've been thinking about relationship, but I'm not too clear about the usage of that in the situation of WordPress. Would you mind describe what you need and let's work on a good solution?

    in reply to: sort_clone is not working at some points #7787
    Anh TranAnh Tran
    Keymaster

    Great! Happy holidays ๐Ÿ™‚

    in reply to: โœ…Add clone id #7782
    Anh TranAnh Tran
    Keymaster

    Hi, can you please give me more info about the "dynamic options"? And the clone ID you're talking about is the ID of inputs in the group?

    in reply to: sort_clone is not working at some points #7771
    Anh TranAnh Tran
    Keymaster

    I've found the bug and fixed it in version 1.2.12 of Group extension. Please update.

    Anh TranAnh Tran
    Keymaster

    Hi G.,

    I guess I understand your point. Probably the code that saves data happens after your code that hides menus, metaboxes, etc. Would you please post your code here so I can debug that?

    in reply to: โœ…How to auto load-more for very large fieldset? #7766
    Anh TranAnh Tran
    Keymaster

    Hi,

    For your needs, the image_select field seems to be the suitable field type. However, it doesn't have the pagination or search feature. To do that, I think you need to write a custom code using a filter library like ListJS (there are probably more libraries).

    You can hook to rwmb_enqueue_scripts action to enqueue your JS like this:

    add_action( 'rwmb_enqueue_scripts', function() {
        wp_enqueue_style( 'listjs', 'URL here' );
        wp_enqueue_script( 'listjs', 'URL here' );
        wp_enqueue_script( 'your-js', 'URL here' );
    } );

    And in your JS file, you can write the JS that does the filtering or searching.

    in reply to: Blank Variable Error #7765
    Anh TranAnh Tran
    Keymaster

    Hi,

    Looks like you're using cloneable groups. For each value of a group, please check the existence of sub-fields, like this:

    $title = isset( $item_item_item['title'] ) ? $item_item_item['title'] : '';
    echo $title;
    in reply to: Validation of field 1 or field 2 #7755
    Anh TranAnh Tran
    Keymaster

    Hey Infolu,

    This can be achieve by using Compound Statements in Conditional Logic.
    https://docs.metabox.io/extensions/meta-box-conditional-logic/#compound-statements

    Here is my example, the field Address will visible when Full Name or Email has filled.

    
    add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
    
    	$meta_boxes[] = array(
            'id'         => 'personal',
            'title'      => 'Personal Information',
            'post_types' => 'post',
            'context'    => 'normal',
            'priority'   => 'high',
    
            'fields' => array(
                array(
                    'name'  => 'Full Name',
                    'desc'  => 'Full name',
                    'id'    => 'name',
                    'type'  => 'text',
                ),
                array(
                    'name'  => 'Email',
                    'desc'  => 'Email Address',
                    'id'    => 'email',
                    'type'  => 'email',
                ),
                array(
                	'name' => 'Address',
                	'desc' => 'Address',
                	'id' => 'Address',
                	'type' => 'text',
                	'visible' => [
                		'when' => [
                			['name', '!=', ''],
                			['email', '!=', '']
                		],
                		'relation' => 'or'
                	]
                )
            )
    	);
    
    	return $meta_boxes;
    } );
    
Viewing 15 posts - 2,551 through 2,565 (of 3,958 total)