title: Wordpress Get value of hidden input field in functions.php
body: <p>I have a hidden input field, which I want to fetch in my <code>functions.php</code>, but I keep getting  <code>NULL</code> as a return value. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>add_filter('woocommerce_add_cart_item_data', 'add_custom_field_data_to_cart', 10, 2 );
  
  function add_custom_field_data_to_cart($cart_item_data, $product_id, $variation_id) {
      $cart_item_data['myHiddenInput'] = $_POST['myHiddenInput']; 
      return $cart_item_data;
  }
  </code></pre>
  
  <p>Can someone maybe tell me why I get <code>NULL</code> ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The hidden input field is on my <code>archive-products.php</code> of my <code>woocommerce</code>-shop</p>
  
  <pre><code>&lt;input type="hidden" name="myHiddenInput" value=""&gt;
  </code></pre>
  
  <p>The value gets set by using <code>javascript</code></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>What I want to achive is, that I have an archive-products page where all my products are listed. Now, above my products I have a tab-menu with the next 5 days of the week. So I click the tab "Wednesday 19." the value of the hidden input gets the date of the active menu-tab:</p>
  
  <pre><code>&lt;input type="hidden" name="chosenDate" value="2018-09-19"&gt;
  </code></pre>
  
  <p>Now I add a product to my cart. Then I click the menu-tab "Friday 21." - the value of the hidden filed gets updated -> I add a product to the cart.</p>
  
  <p>Now when I go to my cart page - I want the products to have the dates listed when they will get delivered (the dates from the menu-tab when they were added)</p>