Title: Restricting Custom Fields inside PHP template
Last modified: March 26, 2018

---

# Restricting Custom Fields inside PHP template

 *  Resolved [luckydays](https://wordpress.org/support/users/luckydays/)
 * (@luckydays)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/restricting-custom-fields-inside-php-template/)
 * Hi Joachim.
 * Seems your plugin is really exactly what I was looking for!
    Thank you for it.
 * Could you assist me with the following, please?
 * We need to restrict access to separate custom fields (created with Advanced Custom
   Fields plugin) which are been displayed on the page through the ACF PHP snippet.
   
   For instance, we need to restrict access to the ‘Address’ field, which is displaying
   with this part of the code:
 *     ```
       $map_location = get_field( 'google_map' );
       echo $map_location['address'];
       ```
   
 * The question is how could we exactly implement the shortcode which you were referring
   to in [your post](https://wordpress.org/support/topic/user-access-in-php-templates/#post-9624984),
   in order to be able to show ‘Tease & Include’?
 * Looking forward to your reply.
 * Best wishes,
    Paul
    -  This topic was modified 8 years, 2 months ago by [luckydays](https://wordpress.org/support/users/luckydays/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/restricting-custom-fields-inside-php-template/#post-10132523)
 * Great that you found the other post 🙂
 * Currently shortcodes do not work with the “Tease & Include” action, but there
   is a parameter you can use to display content to unauthorized users.
 * [restrict level=”level” page=”id”]
    Only users with the specified level can see
   this text. All other users will se content from the page with the specified id.[/
   restrict]
 * Let me know if this answers your question!

Viewing 1 replies (of 1 total)

The topic ‘Restricting Custom Fields inside PHP template’ is closed to new replies.

 * ![](https://ps.w.org/restrict-user-access/assets/icon-256x256.png?rev=1815922)
 * [Restrict User Access - Ultimate Membership & Content Protection](https://wordpress.org/plugins/restrict-user-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-user-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-user-access/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-user-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-user-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-user-access/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * 1 reply
 * 2 participants
 * Last reply from: [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/restricting-custom-fields-inside-php-template/#post-10132523)
 * Status: resolved