title: Use php to identify duplicate settings
body: <p>I am building a wordpress theme, in the theme customizer you can choose Google fonts for the Body Text, Headings and Navbar.</p>
  
  <p>Below shows how I am currently importing the fonts chosen into a custom-css.php file that is called in the head of my page:</p>
  
  <pre><code>$base_font = get_theme_mod('font_base_family');
  $headers_font = get_theme_mod('font_headings_family');
  $menu_font = get_theme_mod('font_nav_family');
  
  if($base_font !='') { ?&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=&lt;?php echo str_replace(" ","+",$base_font );?&gt;:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'&gt;
  &lt;?php } ?&gt; 
  
  &lt;?php if ($headers_font != '') { ?&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=&lt;?php echo str_replace(" ","+",$headers_font );?&gt;:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'&gt;
  &lt;?php } ?&gt;
  
  &lt;?php if ($menu_font != '') { ?&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=&lt;?php echo str_replace(" ","+",$menu_font );?&gt;:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Then later down in my custom-css.php file I have something like this (shortened):</p>
  
  <pre><code>body {
  font-family: &lt;?php echo get_theme_mod('font_base_family'); ?&gt;;
  }
  h1, h2, h3, h4, h5, h6 {
  font-family: &lt;?php echo get_theme_mod('font_headings_family'); ?&gt;;
  }
  #header nav ul li &gt; a, #header nav ul li &gt; span {
  font-family: &lt;?php echo get_theme_mod('font_nav_family'); ?&gt;;
  }
  </code></pre>
  
  <p>The issue I have is obviously loading 3 fonts like this, with all the font weights too, drastically increases page load time. If a user wants 3 differents fonts for each, that's fine, however say they decide to have 2 or 3 of the same fonts, I don't want to have duplicates in my head.</p>
  
  <p>Say for example then someone wants the same font for Body and Headings, is there a way I can, using php, say "If a is the same as b or c - remove the duplicate"</p>
  
  <p>Hope that makes sense.</p>