May 27, 2013 at 6:36 pm 4248
|Tareq Hasan||Hi there, I have created several posts on the site, but the edit link shows up only for the Admin, not for the user, who created the post. Can you help with this please? Thanks, Adrian|
May 28, 2013 at 1:54 am 4255
By default, WordPress doesn’t give subscribers and contributors the capability to edit a post. They even don’t give subscribers for posting, only contributors can submit a post but can’t edit them. So it’s a permission or capability problem.
So for this problem, you could change the user roles or you could change/replace the default WP’s edit link with yours. If you want to use a custom edit link only for WP User Frontend, use this snippet, it’ll give you a edit link for current post.
printf( ‘<a href="%s">%s</a>’, wp_nonce_url( $url, ‘wpuf_edit’ ), __( ‘Edit’, ‘wpuf’ ) );
May 28, 2013 at 2:44 pm 4279
I see. Thank you for the reply!
Can I place the above code to the single.php or somewhere else to have the edit available for all the posts for the user, who created it?
May 28, 2013 at 3:42 pm 4280
Yeah, replace the edit_link code with this code.
June 4, 2013 at 4:42 pm 4547
I cannot find this edit_link code, could you tell me where is it? (file and line)
Thanks very much!
June 4, 2013 at 10:33 pm 4553
the edit_link is in your theme, not in the plugin. That code is responsible for displaying the post edit link. If you don’t find it, insert the code where you want to show your edit link.
June 16, 2013 at 5:50 pm 4935
I’ve put the code in the functions.php, but doesn’t work. Is this the file that I have to edit? Or should this code be inserted in a different file?
June 16, 2013 at 6:29 pm 4939
I’ve already mentioned it’s your theme and look into single.php.