title: See if one of custom fields in a custom post type has text
body: <p>Building a feature that would check if a certain "token" exists in one of the fields of custom post type. I've put all the fields into array, and checked the array, but it doesn't seem to detect the text when it's there.</p>
  
  <p>Here is my code</p>
  
  <pre><code>$titlevar = get_the_title();
  $subbttl = get_post_meta(get_the_ID(), 'related-subttl', true);
  $relcrea = get_post_meta(get_the_ID(), 'related-creative', true);
  $repnt = get_post_meta( get_the_ID(), 'related-points', true);
  $geoarray = array($titlevar, $subbttl, $relcrea, $repnt);
  if (in_array("{{city}}", $geoarray)) {
      echo "Got City";
  } 
  elseif (in_array("{{state}}", $geoarray)) {
      echo "Got State";
  }
  </code></pre>
  
  <p>The end goal is to see if any one of these fields has "{{city}}" or "{{state}}" string. If they do, a geoip api is called, region or city is assigned to variable, and that variable substitutes "{{city}}" or "{{state}}" token. I've got everything else working. I can check each field individually and attach above described functionality- no problem too. But I don't want to do an api call if there are none of these tokens or 4 api calls if all 4 fields have them each. Becomes a little expensive. </p>