I want to show a link in a view only to admin users

By: Naomi Spirit | Asked: 10/29/2024
ForumsCategory: General questionsI want to show a link in a view only to admin users
Naomi SpiritNaomi Spirit asked 18 hours ago
I want to display something in my view only visible to admin users (a link back to the entry). Any ideas how?  I've tried putting some php in the view but it converts it into text so looking for another method.
2 Answers
Victor Font answered 16 hours ago
As you already learned, PHP does not get entered in the editor. To show a link only to admins create a custom shortcode to display the link through this hook: https://formidableforms.com/knowledgebase/frm_display_entry_content/   Your code needs to test whether the current user is an admin or not and then branch accordingly. 
Rob LeVineRob LeVine answered 14 hours ago
You can also create a custom shortcode that takes parameters and passes back the URL you want to display (or nothing, in the case where it's a non-admin).

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right