Home › Forums › General Issues › WPAllImport: Select between input values to import to ACF field › Reply To: WPAllImport: Select between input values to import to ACF field
Indeed. So far, I have this thanks to their help…
// 4. WPAllImport function - Import "avatar" user meta from first available image URL in input data
function profile_photo($photo_url,$cb_avatar,$cb_twitter_avatar,$cb_aboutme_avatar,$cb_gravatar_avatar){
if(!empty($photo_url))
return $photo_url;
if(!empty($cb_avatar))
return $cb_avatar;
if(!empty($cb_twitter_avatar))
return $cb_twitter_avatar;
if(!empty($cb_aboutme_avatar))
return $cb_aboutme_avatar;
if(!empty($cb_gravatar_avatar))
return $cb_gravatar_avatar;
}
/* Execute in WPAI import using...
[profile_photo({photo_url[1]}, {cb_avatar[1]}, {cb_twitter_avatar[1]}, {cb_aboutme_avatar[1]}, {cb_gravatar_avatar[1]})]
... wherein profile_photo is function name) */
I will update this thread if I learn more.
I had looked at the WPAI docs but, though I understand any PHP can be used in the functions and I have a smattering of PHP, I still needed some info to get going on basics like passing variables in and out of the function.
Thanks.
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.