Multiple plugins with meta-box on same WordPress dissappear fields

Support General Multiple plugins with meta-box on same WordPress dissappear fieldsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35458
    MaxMMaxM
    Participant

    Hi, i made two different plugin and load meta-box trough a third plugin. This third plugin load only meta-box trough composer.
    But there is a big problem, in backend one of two plugin not load any metabox and not show input any fields. When i disable other plugin setting fields appear...

    I notice an error in debug log.
    i use this function for retriving fields name
    rwmb_get_registry( 'meta_box' )->get( $metabox_id )->meta_box['fields']
    But RWMB_Meta_Box_Storage not has my $metabox_id fields in it ... Why?

    Plugin 1)
    I use meta-box for make cpt + metabox. On front end i use only get_post_meta function for reading value. I read meta value in wp_head hook.

    Plugin 2) This plugin have problem described above.
    I use meta-box for making cpt + metabox. On front end with hook template_redirect i read value of custom meta fields with
    rwmb_get_registry( 'meta_box' )->get( $metabox_id )->meta_box['fields']
    and after with
    rwmb_get_value

    Any suggenstion?
    How can i make two plugins with meta-box and use on same site?

    #35461
    MaxMMaxM
    Participant

    Resolved.

    One plugin has wrong metabox definition fields.

    Wrong

    add_filter( 'rwmb_meta_boxes', function(){
    $myfields[] = [definitions]
    return $myfields
    }, 10);

    Instead of correct definition

    add_filter( 'rwmb_meta_boxes', function($meta_boxes){
    $meta_boxes[] = [definitions]
    return $meta_boxes
    }, 10);
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.