if( !is_array($user_attachments) || ( is_array($user_attachments) && $user_attachments[0]['src'] == "" ) ){
this IF statement needs to be fixed or somewhere above it. user_attachments is empty as in the value of $user_attachments[0][‘src’] = “”
if a default image exists it merges with user_attachments
so we now have a user_attachment array that has index 0 as the default image and index 1 as “”.
is_array user_attachments is always going to be true whether or not there is an default image
so if there is a default image then $user_attachments[1][‘src’] will be “”
you will need to unset user_attachment if there is no default image
then you can go through the old image system where the ‘images’ field had images for gallery.
reason for above is i had ‘images’ set with images. when transferred i added a featured image and the gallery didnt show up but the featured image did
This reply is for PremiumPress customers only.
405
Views
3
Replies
Copyright © 2010-2026 PremiumPress Limited.
if( !is_array($user_attachments) || ( is_array($user_attachments) && $user_attachments[0]['src'] == "" ) ){this IF statement needs to be fixed or somewhere above it.
user_attachments is empty as in the value of $user_attachments[0][‘src’] = “”
if a default image exists it merges with user_attachments
so we now have a user_attachment array that has index 0 as the default image and index 1 as “”.
is_array user_attachments is always going to be true whether or not there is an default image
so if there is a default image then $user_attachments[1][‘src’] will be “”
you will need to unset user_attachment if there is no default image
then you can go through the old image system where the ‘images’ field had images for gallery.
reason for above is i had ‘images’ set with images.
when transferred i added a featured image and the gallery didnt show up but the featured image did
Members Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login NowMembers Only Content
This reply is for PremiumPress customers only.
Login Now