title: How do I change button text from "Choose an option" in Woocommerce?
body: <p>How would I go about changing this PHP code to to change Choose an option based on the id of the select element in the Woocommerce plugin for WordPress? I believe I have found the correct PHP file in wc-template-function.php but my lack of PHP skills is holding me back. Here is what I have so far:</p>
  
  <pre><code>if ( ! function_exists( 'wc_dropdown_variation_attribute_options' ) ) {
  
      /**
       * Output a list of variation attributes for use in the cart forms.
       *
       * @param array $args
       * @since 2.4.0
       */
      function wc_dropdown_variation_attribute_options( $args = array() ) {
          $args = wp_parse_args( $args, array(
              'options'          =&gt; false,
              'attribute'        =&gt; false,
              'product'          =&gt; false,
              'selected'         =&gt; false,
              'name'             =&gt; '',
              'id'               =&gt; '',
              'class'            =&gt; '',
              'show_option_none' =&gt; __( 'Choose an option', 'woocommerce' ),
              'show_option_color' =&gt; __( 'Choose a color', 'woocommerce' ),
              'show_option_size' =&gt; __( 'Choose a size', 'woocommerce' )
          ) );
  
          $options   = $args['options'];
          $product   = $args['product'];
          $attribute = $args['attribute'];
          $name      = $args['name'] ? $args['name'] : 'attribute_' . sanitize_title( $attribute );
          $id        = $args['id'] ? $args['id'] : sanitize_title( $attribute );
          $class     = $args['class'];
  
          if ( empty( $options ) &amp;&amp; ! empty( $product ) &amp;&amp; ! empty( $attribute ) ) {
              $attributes = $product-&gt;get_variation_attributes();
              $options    = $attributes[ $attribute ];
          }
  
          echo '&lt;select id="' . esc_attr( $id ) . '" class="' . esc_attr( $class ) . '" name="' . esc_attr( $name ) . '" data-attribute_name="attribute_' . esc_attr( sanitize_title( $attribute ) ) . '"&gt;';
  
          if ( $args['show_option_none'] ) {
              echo '&lt;option value=""&gt;' . esc_html( $args['show_option_none'] ) . '&lt;/option&gt;';
          }
          if ( $args['$id_colors'] ) {
              echo '&lt;option value=""&gt;' . esc_html( $args['show_option_color'] ) . '&lt;/option&gt;';
          }
          if ( $args['$id_sizes'] ) {
              echo '&lt;option value=""&gt;' . esc_html( $args['show_option_size'] ) . '&lt;/option&gt;';
          }
  
          if ( ! empty( $options ) ) {
              if ( $product &amp;&amp; taxonomy_exists( $attribute ) ) {
                  // Get terms if this is a taxonomy - ordered. We need the names too.
                  $terms = wc_get_product_terms( $product-&gt;id, $attribute, array( 'fields' =&gt; 'all' ) );
  
                  foreach ( $terms as $term ) {
                      if ( in_array( $term-&gt;slug, $options ) ) {
                          echo '&lt;option value="' . esc_attr( $term-&gt;slug ) . '" ' . selected( sanitize_title( $args['selected'] ), $term-&gt;slug, false ) . '&gt;' . apply_filters( 'woocommerce_variation_option_name', $term-&gt;name ) . '&lt;/option&gt;';
                      }
                  }
              } else {
                  foreach ( $options as $option ) {
                      // This handles &lt; 2.4.0 bw compatibility where text attributes were not sanitized.
                      $selected = sanitize_title( $args['selected'] ) === $args['selected'] ? selected( $args['selected'], sanitize_title( $option ), false ) : selected( $args['selected'], $option, false );
                      echo '&lt;option value="' . esc_attr( $option ) . '" ' . $selected . '&gt;' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '&lt;/option&gt;';
                  }
              }
          }
  
          echo '&lt;/select&gt;';
      }
  }
  </code></pre>
  
  <p>You can see where I tried to add show_option_color and show_option_size in to the array and then add if statements for them, but it doesn't seem to be working. I'm not sure how to reference the id of the select element and write the if statement based on if its is the correct select element.</p>
  
  <p>Here is the HTML I'm trying to target.</p>
  
  <pre><code>&lt;select id="sizes" class="" name="attribute_sizes" data-attribute_name="attribute_sizes"&gt;Want this to say Choose a size&lt;/select&gt;
  
  &lt;select id="colors" class="" name="attribute_sizes" data-attribute_name="attribute_sizes"&gt;Want this to say Choose a color&lt;/select&gt;
  </code></pre>
  
  <p>variable.php code lines 27 - 38:</p>
  
  <pre><code>&lt;?php foreach ( $attributes as $attribute_name =&gt; $options ) : ?&gt;
                      &lt;tr&gt;
                          &lt;td class="label"&gt;&lt;label for="&lt;?php echo sanitize_title( $attribute_name ); ?&gt;"&gt;&lt;?php echo wc_attribute_label( $attribute_name ); ?&gt;&lt;/label&gt;&lt;/td&gt;
                          &lt;td class="value"&gt;
                              &lt;?php
                                  $selected = isset( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) : $product-&gt;get_variation_default_attribute( $attribute_name );
                                  wc_dropdown_variation_attribute_options( array( 'options' =&gt; $options, 'attribute' =&gt; $attribute_name, 'product' =&gt; $product, 'selected' =&gt; $selected ) );
                                  echo end( $attribute_keys ) === $attribute_name ? '&lt;a class="reset_variations" href="#"&gt;' . __( 'Clear selection', 'woocommerce' ) . '&lt;/a&gt;' : '';
                              ?&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;?php endforeach;?&gt;
  </code></pre>