Home › Forums › Add-ons › Gallery Field › Gallery returns in both image id/array
Hi I accidentally deleted one of the gallery field and saved, and then I added the gallery back with the same field name in order to retrieve the entered data back.
After that, the gallery field returns in different formats for different posts..
here is the example:
Original format:
[0] => Array
(
[ID] => 8360
[id] => 8360
[title] => FullSizeRender (25)
[filename] => FullSizeRender-25.jpg
[url] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25.jpg
[alt] =>
[author] => 2
[description] =>
[caption] =>
[name] => fullsizerender-25
[date] => 2016-06-29 10:49:49
[modified] => 2016-07-27 06:12:29
[mime_type] => image/jpeg
[type] => image
[icon] => http://www3.hanartspace.com/wp-includes/images/media/default.png
[width] => 2657
[height] => 2127
[sizes] => Array
(
[thumbnail] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-200×200.jpg
[thumbnail-width] => 200
[thumbnail-height] => 200
[medium] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-400×320.jpg
[medium-width] => 400
[medium-height] => 320
[medium_large] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-768×615.jpg
[medium_large-width] => 768
[medium_large-height] => 615
[large] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-600×480.jpg
[large-width] => 600
[large-height] => 480
[extra-large] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-900×720.jpg
[extra-large-width] => 900
[extra-large-height] => 720
[extra-extra-large] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25-1200×961.jpg
[extra-extra-large-width] => 1200
[extra-extra-large-height] => 961
[nl-thumb] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25.jpg
[nl-thumb-width] => 600
[nl-thumb-height] => 480
[nl-detail] => http://www3.hanartspace.com/wp-content/uploads/2016/06/FullSizeRender-25.jpg
[nl-detail-width] => 900
[nl-detail-height] => 720
)
)
…
…
..
2nd Format (only returns the attachment ids):
(
[0] => 8390
[1] => 8399
[2] => 8381
[3] => 8384
[4] => 8396
[5] => 8372
)
any idea why this is happening, and wondering if there is a way to return only one format?
nevermind, i found the issue.
in order to return the correct format i need to re-save the post.
please close the thread,
thanks
The topic ‘Gallery returns in both image id/array’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.