Get Affiliate customer field (type=file)
-
We created a custom field of type File named partner_logo.
We need to display partner logo of the affiliate ID in some pages so we created a shortcode to get the affiliate logo (custom field).The $affiliate->get(‘partner_logo’); is always returning NULL.
Any idea? Please help !
function wi_render_logo_affiliate() { ? ? if (isset($_COOKIE['slicewp_aff'])) { ? ? ? ? $affiliate_id = $_COOKIE['slicewp_aff']; ? ? ? ? // Get affiliate object using the ID from the cookie ? ? ? ? $affiliate = slicewp_get_affiliate($affiliate_id); ? ? ? ? if (!is_null($affiliate)) { ? ? ? ? ? ? // Access properties of the affiliate object ? ? ? ? ? ? $affiliate_status = $affiliate->get('status'); ? ? ? ? ? ? $user = get_userdata( $affiliate->get( 'user_id' ) ); ? ? ? ? ? ? $affiliate_url = $user->get('website'); ? ? ? ? ? ? $affiliate_logo = $affiliate->get('partner_logo'); ? ? ? ? ? ? return var_dump($affiliate); ? ? ? ? } ? ? } ? ? return 'No affiliate'; }
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get Affiliate customer field (type=file)’ is closed to new replies.