Custom Fields
Re-Envisioned
Support MB User Profile Issues with frontend forms

  • Creator
    Topic
  • #17885
    Resolved TravisEstes
    Participant

    Hey there! I’m having two issues with my forms:

    1) Seems Login only works when you do it twice
    2) My Profile form is not allowing Image Uploads or multiselect anymore. When I make it a frontend form attached to a Post Type, the Frontend Submission shortcode does give the user Image Upload + select options. But when I assign the same form instead to Users, suddenly those options disappear in the frontend form.

    Thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #17896
    Anh Tran
    Keymaster

    Hi,

    1) Do you have any code related to login? It seems to work fine in my test.
    2) Have you added proper permission for users to upload? Can you share your code?

    #17921
    TravisEstes
    Participant

    1) I’m going to double check that it’s not just a caching issue 😉 with WPEngine

    2) Yes, I have! This is the code I added to functions.php:

    function mb_allow_subscriber_uploads() {
        if ( is_admin() ) {
            return;
        }
    
    // Replace 'subscriber' with the required role to update, can also be contributor.
    $subscriber = get_role( 'freelancer' );
    $subscriber->add_cap( 'upload_files' );
    
    }
    add_action( 'init', 'mb_allow_subscriber_uploads' );

    Note that I actually have TWO roles that I’ll need this for, not just one. Unsure how the code needs to change to account for two roles.

    #17928
    TravisEstes
    Participant

    Follow up:

    1) Was a caching issue!

    2) This is still broken. It seems my multiselect and slider tools don’t work either. Note that this only happens when I attach the metaboxes to Users instead of a Post Type. Otherwise my users would have no issue…but I kinda need these fields mapped to Users 😉

    Made a video of the issue if it helps:

    https://www.loom.com/share/65acd0696b75436cad30c8f6be599059

    #17948
    Anh Tran
    Keymaster

    I see. Thanks for your video.

    That might be a problem of enqueuing assets on the front end for user profiles. I’ve just fixed in the latest version. Please update and try again.

    #17949
    TravisEstes
    Participant

    OH MY GOSH THAT WORKED! Thank you Anh, you are a rockstar!!!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash