Title: Does the array also contains post_id?
Last modified: September 1, 2016

---

# Does the array also contains post_id?

 *  Resolved [nicmare](https://wordpress.org/support/users/nicmare/)
 * (@nicmare)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/does-the-array-also-contains-post_id/)
 * What if i select a local page? do you also store the id (if it exists) in the
   array?
 * [https://wordpress.org/plugins/acf-link/](https://wordpress.org/plugins/acf-link/)

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

 *  Plugin Author [Corey Worrell](https://wordpress.org/support/users/coreyw/)
 * (@coreyw)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/does-the-array-also-contains-post_id/#post-7664291)
 * Hi [@nicmare](https://wordpress.org/support/users/nicmare/),
 * The native WP picker does not expose the post ID in this instance, so it is not
   stored in the array.
 * If you’d rather have the ID it might be better to use the Post Object field instead,
   and have a field to select internal/external link type, and then show the corresponding
   field (post object or url).
 * Or if you’d rather keep using the Link field, you can add a filter via [`acf/format_value/type=link`](https://www.advancedcustomfields.com/resources/acfformat_value/)
   where you could possibly check the hostname of the value to test if if is an 
   internal link, and then split the value to get just the pathname (ie: /page-name/)
   and then use [`get_page_by_path`](https://codex.wordpress.org/Function_Reference/get_page_by_path)
   to get the ID (can be used with all post types as seen on documentation page 
   linked above).
 *  Plugin Author [Corey Worrell](https://wordpress.org/support/users/coreyw/)
 * (@coreyw)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/does-the-array-also-contains-post_id/#post-7664495)
 * Marking as resolved

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

The topic ‘Does the array also contains post_id?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/acf-link_f7921e.svg)
 * [Advanced Custom Fields: Link](https://wordpress.org/plugins/acf-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-link/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-link/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Corey Worrell](https://wordpress.org/support/users/coreyw/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/does-the-array-also-contains-post_id/#post-7664495)
 * Status: resolved