Title: Field Return Function
Last modified: June 28, 2022

---

# Field Return Function

 *  Resolved [harryfear](https://wordpress.org/support/users/harryfear/)
 * (@harryfear)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/)
 * Does pods not provide a function like `get_the_field` or `the_field` to return
   field values like ACF?
 * In our desired use case, we want to return a value of a field from a Pods settings
   page.
 * For now, we have polyfilled with a custom snippet function that executes the 
   do_shortcode for “[pods ……]” but this is not very clean.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778264)
 * For settings pages, you can use `get_option()` [https://developer.wordpress.org/reference/functions/get_option/](https://developer.wordpress.org/reference/functions/get_option/)
 * But Pods does actually include ACF compatibility so you could technically use
   the same functions you used in ACF for that part 🙂
 * Pods has it’s own functions for this though, so if you want to do it the normal
   Pods way then you can follow the docs here:
    - Optimized for multiple field lookups, use our [Pods object](https://docs.pods.io/code/pods/)
      and the [field()](https://docs.pods.io/code/pods/field/) or [display()](https://docs.pods.io/code/pods/display/)
      method depending on use-case
    - Global functions that map to our Pods object but could increase memory usage
      at scale because they need to do additional set up for each call, use [pods_field()](https://docs.pods.io/code/field-functions/pods_field/)
      or [pods_field_display()](https://docs.pods.io/code/field-functions/pods_field_display/)
 * Hope this helps clear things up for you, happy Pods-ing!
 *  Thread Starter [harryfear](https://wordpress.org/support/users/harryfear/)
 * (@harryfear)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778313)
 * Thanks so much!
 * For posterity, we ended up with this:
 *     ```
       echo pods_field('site_settings',null,'banner_text')
       ```
   
 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778423)
 * Any time you echo, you should use `pods_field_display` in that context. Always
   use the `display()` variation because it handles output escaping for you. Otherwise,
   be sure to update your code to something like this to escape it on your side:
 * `echo esc_html( pods_field( 'site_settings', null, 'banner_text' ) );`
 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778437)
 * If your Pods field allows for HTML, then `display()` will handle all of the logic
   needed to ensure only the HTML tags you allowed will be output. This is generally
   necessary for security when you offer fields like these because someone could
   gain access to your DB and be able to hijack your output without you ever knowing.
 *  Thread Starter [harryfear](https://wordpress.org/support/users/harryfear/)
 * (@harryfear)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778443)
 * Thank you! That’s perfect!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Field Return Function’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [harryfear](https://wordpress.org/support/users/harryfear/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/field-return-function/#post-15778443)
 * Status: resolved