title: Return two shortcodes with one function [Wordpress PHP]
body: <p>I am attempting to merge the following two functions into one, which are completely identical other than the $utmphone and $utmphonedirect</p>
  <pre><code>// UTM Change Toll Free Phone
   add_action( 'wp_head', 'toll_phone' );
  function toll_phone() { 
  $utmphone = '&lt;a class=&quot;whitehref&quot; href=&quot;tel:8004806850&quot;&gt;800-480-6850&lt;/a&gt;';
  if(isset($_COOKIE['utm']) &amp;&amp; $_COOKIE['utm']== &quot;ccov&quot; || (strpos($_SERVER['REQUEST_URI'], &quot;ccov&quot;))) { 
  $utmphone = '&lt;a class=&quot;whitehref&quot; href=&quot;tel:8004484285&quot;&gt;(800) 448-4285&lt;/a&gt;'; 
  setcookie('utm', 'ccov', time() + (86400 * 30), &quot;/&quot;);
  }
  return $utmphone;
  }
  add_shortcode('utmphone', 'toll_phone');  
  
  // UTM Change Direct Phone
  function direct_phone() { 
  $utmphonedirect = '&lt;a href=&quot;tel:312-666-3552&quot;&gt;312-666-3552&lt;/a&gt;';
  if(isset($_COOKIE['utm']) &amp;&amp; $_COOKIE['utm']== &quot;ccov&quot; || (strpos($_SERVER['REQUEST_URI'], &quot;ccov&quot;))) { 
  $utmphonedirect = '&lt;a href=&quot;tel:8722604892&quot;&gt;(872) 260-4892&lt;/a&gt;';
  }
  return $utmphonedirect;
  }
  add_shortcode('utmphonedirect', 'direct_phone'); 
  </code></pre>
  <p>I have tried the following, but it is only returning one of the values - therefore both shortcodes are displaying the same. I have also searched the web for a simple answer for something like this and found nothing.</p>
  <p>The goal is to output two unique values for both shortcodes: utmphone and utmphonedirect</p>
  <pre><code>// UTM Change BOTH Phones
   add_action( 'wp_head', 'toll_phone' );
  function toll_phone() { 
  $utmphone = '&lt;a class=&quot;whitehref&quot; href=&quot;tel:8004806850&quot;&gt;800-480-6850&lt;/a&gt;';
  $utmphonedirect = '&lt;a href=&quot;tel:312-666-3552&quot;&gt;312-666-3552&lt;/a&gt;';
  if(isset($_COOKIE['utm']) &amp;&amp; $_COOKIE['utm']== &quot;ccov&quot; || (strpos($_SERVER['REQUEST_URI'], &quot;ccov&quot;))) { 
  $utmphone = '&lt;a class=&quot;whitehref&quot; href=&quot;tel:8004484285&quot;&gt;(800) 448-4285&lt;/a&gt;'; 
  $utmphonedirect = '&lt;a href=&quot;tel:8722604892&quot;&gt;(872) 260-4892&lt;/a&gt;';
  setcookie('utm', 'ccov', time() + (86400 * 30), &quot;/&quot;);
  }
  return $utmphone;
  return $utmphonedirect;
  }
  add_shortcode('utmphone', 'toll_phone');  
  add_shortcode('utmphonedirect', 'direct_phone'); 
  </code></pre>