Support » Plugin: Gravity Forms: Post Updates » Works perfectly for admin, but not for other roles

  • Resolved Accur

    (@accur)


    Using this “apply_filters(‘gform_update_post/edit_url’, 1, home_url(‘/edit_post/’));” I was able to create an “edit post” link pointing directly to a Gravity form loading all the post data. But it only pulls the data as ADMIN, but not with another role. With the other role I am using the form is empty.

    Is it a question of adding a certain capability to the role in question? That being said I know nothing about adapting capabilities for each roles.

    Thanks for your help.

    https://wordpress.org/plugins/gravity-forms-post-updates/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Accur

    (@accur)

    Anyone?
    I would sincerely appreciate an advice.
    Thanks very much in advance.

    Thread Starter Accur

    (@accur)

    Ok so I finally found the answer to my issue.

    In the plugin, I noticed the public_edit function was the one allowing users to edit or not posts) and I found this code:
    add_filter(‘gform_update_post/public_edit’, ‘custom_gform_update_post_public_edit’);
    function custom_gform_update_post_public_edit()
    {
    return ‘edit_posts’;
    }
    (found here: https://bitbucket.org/jupitercow/gravity-forms-update-post)

    Since I still don’t understand how add_filter’s are working and struggled a bit on where to place it, it finally worked whne placed directly in the function public_edit in the main file of the plugin.

    Obviously for it to work the user needed to have the “edit_post” capability, so I added it with the Member plugin.

    I hope it will help others too.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Works perfectly for admin, but not for other roles’ is closed to new replies.