Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ryan Stutzman

    (@ryan-stutzman)

    I tried in_array('TH', $userInfo->country->isoCode) but it’s not working. It’s working fine elsewhere on my site. Any ideas?

    Thread Starter Ryan Stutzman

    (@ryan-stutzman)

    For anyone who is interested, I got it to work by registering a custom taxonomy…

    add_action( 'init', 'create_country_tax' );
    function create_country_tax() {
    	$userInfo = geoip_detect2_get_info_from_current_ip();
    	$country = $userInfo->country->isoCode;
    	register_taxonomy($country,'country');
    }

    and then calling taxonomy_exists('US') in the visibility field.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use with other variables?’ is closed to new replies.