I’m trying to display several custom field values on a public wordpress page but only want them visible to admin users, similar to the way private posts are not publicly available but appear to users with the privileges to view them when they are logged in.
Reason: a way to provide additional information regarding products and services that isn’t really meant for the regular visitor.
I can hide custom field sections if their is no value or their value doesn’t match a set of paramaters but cannot figure out how to shown only to a specific user level. Is there a way to do this?
Any help would be greatly appreciated.
You can check the permission of the viewer. From here, use this code fragment: