Home › Toolset Professional Support › [Resolved] Hide "Edit this View" and "Edit this Content Template" mentions
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 19:00 | 10:00 – 19:00 | 10:00 – 19:00 | 10:00 – 19:00 | 10:00 – 19:00 | - |
- | - | - | - | - | - | - |
Supporter timezone: Europe/Madrid (GMT+01:00)
Tagged: Views plugin
This topic contains 7 replies, has 3 voices.
Last updated by Peter 10 years, 7 months ago.
Assisted by: Caridad.
Hello and Happy New Year for you all,
Is there a way I can hide the "Edit this View" and "Edit this Content Template" mentions for Editors and Administrators alike in Views ?
Thank you,
Best,
Stephen
Dear Stephen,
This link is displayed to users that can 'Manage Options', like administrators. Editors should not be seeing this link at all. However, try adding these lines to functions.php to remove them:
add_filter('init', 'remove_edit_links', 100); function remove_edit_links() { remove_all_filters('edit_post_link'); }
Please let me know if there is anything else that I can assist you with.
Regards,
Caridad
Thanks Caridad,
The link is hidden on Posts.
But the link still appears on the Pages.
Thanks,
S.
Dear Stephen,
Can you find out how the theme is displaying this link?
Regards,
Caridad
Caridad,
I will send the link to the website to your private email address. Do not disclose please.
Best,
Stephen
Dear Stephen,
As far as I can see, the links that we still need to remove are the widget links, but there is not filter to remove them like with the others. A workaround is to detect the text when its being translated and removing it there. I added these lines to the ones above and its working:
add_filter('gettext', 'remove_widget_links', 100, 3); function remove_widget_links($translated, $text, $domain) { if ($text == 'Edit view') return ''; return $translated; }
Please let me know if there is anything else that I can assist you with.
Regards,
Caridad
Thanks Caridad,
It works fine and I will definitely add this code snippet to my standard library!
Best,
Stephen
Caridad wrote:
"This link is displayed to users that can 'Manage Options', like administrators. Editors should not be seeing this link at all."
This link is being displayed to Editors in Views 1.2.1, when a View is embedded on a Page. Is this a bug?