title: Default value for dropdown - WordPress site
body: <p>I am working on a WordPress site that has a new user registration form. I want to set the default value for the dropdown country list to the US. Currently, the dropdown list selects the first option as the default. The html element looks like this (this is not the whole element, just a piece of it): </p>
  
  <p><code>&lt;select name="wwlc_country" id="wwlc_country"&gt;&lt;option value="AX"&gt;Åland Islands&lt;/option&gt;&lt;option value="AF"&gt;Afghanistan&lt;/option&gt;&lt;option value="AL"&gt;Albania&lt;/option&gt;&lt;option value="US"&gt;United States (US)&lt;/option&gt;</code></p>
  
  <p>I am using a plugin called "WooCommerce Wholesale Lead Capture" and on their support site they suggest adding the following code to my theme's functions.php file: </p>
  
  <pre><code>// Change the default country on WooCommerce Wholesale Lead Capture's registration
  function wwsSetRegistrationDefaultCountry() {
  
  if ( is_page( 'wholesale-registration-page' ) ) {
      ?&gt;
  
      &lt;script type="text/javascript"&gt;
          jQuery(document).ready(function () {
              jQuery('select#wwlc_country').val('AU');
              jQuery('select#wwlc_country').trigger('change');
          });
      &lt;/script&gt;
  
      &lt;?php
  }
  
  }
  add_action( 'wp_footer', 'wwsSetRegistrationDefaultCountry', 99 );
  </code></pre>
  
  <p>I have tried adding this with the correct page in the is_page function, but the page is still defaulting to the first value, regardless of which country I set as the value. I see that the script is running on the page when I view the page source and the script works if I run it in the console. Any ideas why it isn't actually working when I load the page though?</p>
  
  <p><strong>UPDATE</strong>: So I figured out the problem, in case anyone encounters this issue in the future. I have a plugin called "Autoptimize" enabled and one of the settings was preventing the code from running on the site. I disabled the plugin and the dropdown's default value was set to the US after a refresh. </p>