WordPress.org

Support

Support » Plugins and Hacks » Hacks » Hook for allow user as subscriber can edit their comment

Hook for allow user as subscriber can edit their comment

  • //Trick allow user subscriber can edit comment
    function nex_update_cap($allcaps){
    	//print_r($allcaps);
    	global $comment;
    	if( !empty($comment) ){
    		global $current_user;
    
    		if( $current_user->ID == $comment->user_id  ){
    			$allcaps['edit_others_posts'] = 1;
    			$allcaps['edit_published_posts'] = 1;
    		}
    	}
    	return $allcaps;
    }
    add_filter('user_has_cap', 'nex_update_cap');
  • The topic ‘Hook for allow user as subscriber can edit their comment’ is closed to new replies.