Support Forum ยป User Profile

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • nfyp145nfyp145
    Participant

    Wow...

    That works beautifully. You really are the code poet.

    Thank you so much Master Ahn.

    nfyp145nfyp145
    Participant

    But after adding code from step 2...

    the form page (where I insert form shortcode) is blocked with message - You are not allowed to edit this post.

    So there is no chance for guest or subscriber to submit form.

    nfyp145nfyp145
    Participant

    Hello Anh

    Appreciate for reply! I've been waiting for your solution all day - today.

    I try as you guided above.

    After adding snippets from step 1 and 2 in functions.php, ONLY admin can see and submit the form.

    in reply to: "Special Field Type" to group fields? #10689
    nfyp145nfyp145
    Participant

    Hi Tran...

    Not grouping fields via UI.

    Grouping fields (each field) under one special field. Under one roof.

    
    - main_id
        * text_field_id
        * image_field_id
        * slider_field_id
        * time_field_id
        ...
    

    That way, it'd a lot easier when naming all IDs.
    And also, the dev just needs to focus on (main_id) when getting value.

    For example,

    
    /* Post Meta Box */
    
    add_filter('rwmb_meta_boxes', 'set_post_meta_box');
    function set_post_meta_box($meta_boxes) {
        $meta_boxes[] = array(
            'id'         => 'post_meta_box',
            'post_types' => 'post',
            'tab_style'  => 'left',
            'tabs'       => array(
                'box_1_tab' => 'Box 1',
                'box_2_tab' => 'Box 2',
            ),
            'title'      => 'Post Meta Box',
            'fields'     => array(
    
                /* Box 1 */
    
                array(
                    'id'     => 'box_1',
                    'tab'    => 'box_1_tab',
                    'type'   => 'special_fieldset',
                    'fields' => array(
                        array(
                            'id'   => 'title',
                            'name' => 'Title',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'description',
                            'name' => 'Description',
                            'type' => 'textarea',
                        ),
                    ),
                ),
    
                /* Box 2 */
    
                array(
                    'id'     => 'box_2',
                    'tab'    => 'box_2_tab',
                    'type'   => 'special_fieldset',
                    'fields' => array(
                        array(
                            'id'   => 'title', // Same ID from Box 1
                            'name' => 'Title',
                            'type' => 'text',
                        ),
                        array(
                            'id'   => 'description', // Same ID from Box 1
                            'name' => 'Description',
                            'type' => 'textarea',
                        ),
                    ),
                ),
            ),
        );
        return $meta_boxes;
    }
    

    To return values...

    
    $box_1             = rwmb_meta('box_1');
    $box_1_title       = $box_1['title'];
    $box_1_description = $box_1['description'];
    
    $box_2             = rwmb_meta('box_2');
    $box_2_title       = $box_2['title'];
    $box_2_description = $box_2['description'];
    

    Without defining long ID names for each field,
    the dev can return values for Title and Description just using box_1 and box_2 IDs.

    in reply to: "Special Field Type" to group fields? #10684
    nfyp145nfyp145
    Participant

    Of course, I'm using "MB Group" to group different fields. It works well so far.

    
    array(
        'id'          => 'my_content',
        'collapsible' => true,
        'group_title' => 'My Content',
        'type'        => 'group',
        'fields' => array(
            array(
                'id'   => 'title',
                'name' => 'Title',
                'type' => 'text',
            ),
            array(
                'id'   => 'subtitle',
                'name' => 'Subtitle',
                'type' => 'textarea',
            ),
            array(
                'id'   => 'image',
                'name' => 'Image',
                'type' => 'image',
            ),
            array(
                'id'   => 'content',
                'name' => 'Content',
                'type' => 'wysiwyg',
            ),
        ),
    ),
    

    But I'd like to use "MB Group" for specific tasks - such like collapsible, cloneable, sortable...

    Could it be nice having a field type (only) for grouping different custom fields? That way, it'll help reducing server load.

    Thanks again Tran!

    in reply to: Request: Background Field #8042
    nfyp145nfyp145
    Participant

    Hi Anh

    Received update alert from GitHub. And tested the background field. It works perfectly!

    Thank you very much!

    Happy New Year to you and your team.

    in reply to: Request: Background Field #7817
    nfyp145nfyp145
    Participant

    Thanks much Tran. That will be awesome!

    in reply to: sort_clone is not working at some points #7785
    nfyp145nfyp145
    Participant

    Sorry for late confrim.

    It works well now. Thank you so much and appreciate for the fix.

    Happy Holidays Tan!

    in reply to: sort_clone is not working at some points #7622
    nfyp145nfyp145
    Participant

    Appreciate for the reply Tan.

    Eagerly Waiting...

Viewing 9 posts - 1 through 9 (of 9 total)