How to Remove all Instances of edit_post_link

FeaturedSolved1.38K viewspagesphptheme twenty elevenpages php theme twenty eleven
0

Can someone please assist with how to remove from my theme, whilst in author mode, the edit_post_link (Edit link), throughout all my pages. Which php files in the Twenty Eleven theme (WordPress v3.2) do I need to comment out to no longer display this edit link?

I realise that you only see this during author mode but would like to know how to remove altogether.

Thanks.

Question is closed for new answers.
Marked as featured question
0

Use the following code in functions.php file of your theme

add_filter( 'edit_post_link', '__return_false' );

Selected answer as best
1

It’s theedit_post_link()function. You’ll find lines like the following, that you need to comment out:

// from /twentyeleven/content-intro.php
edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' );

Answered question