Home Forums Plugin Support WP User Frontend Pro Lock form fields during post edit

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Mahi 5 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #15957

    ProUser
    Participant
    Post count: 17

    Hi,

    Is it possible to lock specific form fields during post editing (via a frontend form)? If so, how?

    So, when the edit button is clicked and the user is taken to the WP Frontend form, certain form fields can't be changed.

    Thanks!

    #15958

    ProUser
    Participant
    Post count: 17

    I'm thinking I can edit the appropriate plugin file (whichever one is building the form to be edited). I can use an if statement to determine if the logged in user is the post author and, if not, make certain fields readonly.

    But which file and where in that file should I place the code?

    #15964

    ProUser
    Participant
    Post count: 17

    Great! I think this may help me with a hack I'm needing. But where does the code posted by Tareq go, exactly…. from http://wedevs.com/support/topic/hide-fields-in-edit-form/#post-6918

    function wpufe_assign_new_form( $post_id, $form_id ) {
    if ( $form_id == ‘5' ) {
    update_post_meta( $post_id, ‘_wpuf_form_id', 6 );
    }
    }
    add_action( ‘wpuf_add_post_after_insert', ‘wpufe_assign_new_form', 10, 2 );

    This solution will allow me to create a second form with all the fields hidden as needed, leaving only the editable field displayed. But where do I put it?

    Thanks!

    #15980

    Mahi
    Member
    Post count: 1555

    it goes to your theme's function.php file

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Lock form fields during post edit’ is closed to new replies.