How do I convert AddressField "Administrative Area" abbreviation to full name The Address Field module automatically converts administrative area (i.e., State/Province) abbreviations to full names on node display.  I need to do this in my own custom module but can't find the function that the Address Field module uses to do this.  How can it be done?
As mentioned earlier, there's no function in addressfield that does this, it's hard coded and not re-usable.  Instead, there's a function in addressfield_tokens module which DOES do this.  

Using this function isn't really good practice because it's not an official hook (so it could change at anytime without notice), but as long as you're aware of what's going on and you use the proper checks that the module exists, it's the most flexible way to make this happen.  Here's how to use it:

First, ensure that addressfield_tokens.module is installed.  Then you can use this function from line 338 in the .module file:

_addressfield_tokens_state($country, $state)


You need the $country because abbreviations are sometimes the same for different countries.  So, if we wanted to find the full name of California, we would do this:

$california_fullname = _addressfield_tokens_state('US', 'CA')
return $california_fullname;