Custom Fields
Re-Envisioned
Support MB User Meta Saving problem with multiple user roles

This topic contains 5 replies, has 2 voices, and was last updated by  Truong Giang 1 year, 10 months ago.

  • Creator
    Topic
  • #6067
    Resolved
    David
    Participant

    Hi,
    I added a Metaboxes using the User Meta plugin, with a include option:

    ‘include’ => array(
    ‘user_role’ => array(‘user_test’),
    ),

    I need to use multiple roles for each user, so I used this plugin (https://wordpress.org/plugins/multiple-roles/) to enable this “hidden feature”.

    The problem is that activating this plugin, the Metaboxes is properly displayed when a user user_role match to that included in the “includes” option, but when I save the user page, all the metabox.io fields are not saved.

    How could I do to fix it?

    Thanks,
    David

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #6085

    Truong Giang
    Participant

    Hi there,

    Can you provide the code you use to register meta box? I tested with above plugin but don’t meet the issue.
    Thank you.

    #6090

    David
    Participant

    Hi, here the code used to register the Metaboxes.

    https://ghostbin.com/paste/uqmou

    Thanks,
    D

    #6099

    Truong Giang
    Participant

    Hi there,

    We have just updated Meta Box Include Exclude extension. Please update it and check if problem has gone. Thank you.

    #6100

    David
    Participant

    Hi, thanks!
    Now the metabox save their data and the “exclude” option work well, but using the “include” option (like the code above), the Metabox remains visible to all user_roles.

    The backend page: https://tppr.me/mPGHs

    #6119

    Truong Giang
    Participant

    Hi,

    If you (current user) has edit_users capability, you can see the meta box for every roles. Please try creating 2 test users with different roles and login to each account to test.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.