Gravity Forms - Update Post
Restricting Update Post to Post Author (3 posts)

  1. ktrusak
    Posted 2 years ago #

    In the readme it says there is a way to restrict the editing of a post to the author through filters.

    Do you have an example of the filter for this?


  2. riccardo.raneri
    Posted 2 years ago #

    Hi, this post is quite old but it still needs an answer.

    I figured out how to change this settings, for example:

    add_filter('gform_update_post_options', 'gform_update_post_options');
    	public function gform_update_post_options($options)
    	  $options['capabilities'] =  array(
    	      'update' => 'author',
    	      'delete' => 'author'
    	  return $options;

    With this (you can put it in your theme's functions.php), authors can edit (and delete) their posts.

  3. ktrusak
    Posted 2 years ago #

    Hey, thanks for the follow up. That is probably the best route. I couldn't figure out the options so I wrote a work around. I'll post it so if anyone wants it:

    function gf_update_author_check(){
    	if (isset($_GET["gform_post_id"])){ 
    		$id = $_GET["gform_post_id"];
    		$post = get_post( $id );
    		$user = wp_get_current_user();
    			if($user->ID != $post->post_author){ 
    add_action('template_redirect', 'gf_update_author_check', 1);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Gravity Forms - Update Post
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.