• Resolved carrietwist

    (@carrietwist)


    I have restricted edit capabilities to a custom post type where a custom user role can not edit others in the backend and this restricts editing of single posts to the post author. Unfortunately, this is not restricting the ACF front-end form submission to the post author.

    Is there a setting that I am missing for how to do this? Please let me know.

    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    If you’re talking about the native ACF Form feature, then you can simply use some if/else statements and check the currently logged user in order to display/hide the form on the front-end.

    For the ACF Extended Form feature, you can do the same thing and use if/else statements to show/hide the form on the front-end. Here is a usage example.

    If you’re using shortcodes to display the form, you can use the acfe/form/load hook in order to hide the form based on your condition. Here is a usage example.

    An another solution is to not process a specific Form Action using the Action prepare hooks, combined with your condition. For example for the “Post Action”, you can use the acfe/form/prepare/post fitler and return false in order to bypass the action during the form submission and pass to the next action. See documentation. That logic can be applied to any Form Action.

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)

The topic ‘restrict form to post author’ is closed to new replies.