Register different meta_box

Support General Register different meta_box

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4332
    MD3MD3
    Participant

    I want to register 2 metabox, However this approach is not working. I need to separate it within the function

    add_filter('rwmb_meta_boxes', 'cs_metabox1');
    function cs_metabox1(){
    
    }
    add_filter('rwmb_meta_boxes', 'cs_metabox2');
    function cs_metabox2(){
    
    }
    #4334
    Tan NguyenTan Nguyen
    Participant

    You should add $meta_box argument for the function and return $meta_box for the filter

    
    funtion cs_metabox1($meta_box)
    {
        // Do your job here
    
        return $meta_box;
    }
    
    #4338
    MD3MD3
    Participant

    Thanks, it works

    #4339
    Tan NguyenTan Nguyen
    Participant

    Ya welcome. Please don't hesitate to tell us if you have any problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Register different meta_box’ is closed to new replies.