• Resolved sifuhall

    (@sifuhall)


    I am migrating from Toolset Types and so far everything has gone well.

    I have created a new content type.
    Added fields to the new content type.
    Created a template for the new content type to display a single record.
    Created a template to display multiple records of my new content type.
    Created a form (using WPForms) to allow users to submit content.

    My only question left is how do I allow my users to edit content they have submitted?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I don’t think there are any WPForms integrations for Pods that submits and updates items. WPForms and other forms plugins may have Post Type / Custom Field feeds that will handle creation but I’m not familiar with how WPForms handles editing in those scenarios.

    Pods has a PHP way to provide access to edit any item. You would be in charge of handling the exact permissions before outputting the form.

    
    <?php
    $pod = pods( get_post_type(), get_the_ID() );
    
    if ( is_user_logged_in() && get_current_user_id() === $pod->field( 'post_author.ID' ) ) {
        echo $pod->form( [
            'fields' => [
                // Pass the fields to allow editing of.
                'post_title',
                'post_content',
                'your_other_field',
            ],
        ] );
    } else {
        echo 'You do not have access to this form.';
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Allow user to edit?’ is closed to new replies.