MB Relationships + MB Frontend Submission

Support MB Relationships MB Relationships + MB Frontend SubmissionResolved

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #43888
    ChrisChris
    Participant

    I'm in as well. a field type would help a lot.
    Currently, I see not option beside JS to get rid of the "add new Post" in the relationship field in frontend [mb_frontend_form id='the_id_relationships_to'].
    Are there any ways to filter out the "add new" option? I'm using it in a shortcode with multiple custom field groups.

    Thank you

    #43926
    pzapza
    Participant

    Are there any ways to filter out the "add new" option? I'm using it in a shortcode with multiple custom field groups.

    So, it seems you can target the relationship meta box as a normal field group using the same ID as in the form shortcode:

    <?php
    add_action( "rwmb_before_REL_ID_relationships_to", function( $meta_box ) {
        echo '<div id="customID">';
    } );
    add_action( "rwmb_after_REL_ID_relationships_to", function( $meta_box ) {
        echo '</div>';
    } );

    Maybe you can do something similar with validate hooks to change the "add new" option?
    Or as a last resort, give the container ID above and target it with CSS #customID .addnew-class { display: none; }

    Note this hook is after/within the .rwmb-meta-box container -- which doesn't help my case, since that's the div I was trying to hook into.

    I have a really nice, orderly frontend form with tabs. Then at the end ... some select (relationship) fields which I can't control the labels or width of 🙃

    Suggestion
    Ideally a relationship field would work with any MB post/term/user field.

    Then just like the "Set as parent" option, there could be a "Set relationship" option. It would also need to input/select a relationship ID. On save, the current editing object would have the applicable relationships updated.

    I nearly set up several tax_advanced/user/post fields for my case. Then on-save I would need to check that relationship every time, check/delete all existing relationships (looping through them since there's no function to delete all), and set the new relationships according to field input.

    I think it can work....but for now I'm just using the somewhat-random fields at the end of my form.

    Hopefully the devs consider this 🙏 because it would be awesome to manage relationships anywhere within a form/field group, plus control metabox attributes, CSS ID, columns etc.

Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.