title: Using $_GET and $_POST in custom WordPress plugin
body: <p>I'm new to developing plugins for WordPress, I've been doing it for Magento 2 and thought it would be similar, so here I am.</p>
  
  <p>I'm consuming a RESTful API to display information about some courses, it retrieves me the info on all courses so now I have to filter some attributes, for example "city", for this my user has an HTML form to select which city he is in, but when I try to use the "city" field from the form it returns as null, it doesn't matter if I use post or get method.</p>
  
  <p>Which one is the correct form of getting this attributes in WordPress?</p>
  
  <p>this is an example of the form page:</p>
  
  <pre><code>    &lt;?php
  /* 
   * Formulario de filtros
   */
  // create curl resource
  
  require_once('../../../../wp-config.php');
  
  $ciudad = $_POST['ciudad'];
  
  var_dump($ciudad);
  
  $accessToken = '---';
  $apiUrl = 'url';
  
  $curl = curl_init($apiUrl);
  curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer '.$accessToken]);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  $json = curl_exec($curl);
  $cursos = json_decode($json);
  $arr = 0;
  
  foreach($cursos as $k =&gt; $cur)
  {
      $sede = $cur-&gt;Sede;
      if($sede === 'MEDELLIN' ){
      $codigo[] = substr($cur-&gt;Programa, 0, 4);
      $programa[] = $cur-&gt;Programa;
      $precio[] = $cur-&gt;Valor_Contado;
      }
  }
  $cod = array_unique($codigo);
  var_dump($cod);
  foreach ($cod as $c){
      echo "Programa: ".$c."&lt;br&gt;";
  }
  
  ?&gt;
  &lt;div class="filtrosContainer"&gt;
      &lt;form class="filtro-cursos" method="post"&gt;
  &lt;div class="vc_row wpb_row vc_row-fluid edgtf-section edgtf-content-aligment-left"&gt;&lt;div class="clearfix edgtf-full-section-inner"&gt;&lt;div class="wpb_column vc_column_container vc_col-sm-6"&gt;&lt;div class="vc_column-inner "&gt;&lt;div class="wpb_wrapper"&gt;
      &lt;div class="wpb_text_column wpb_content_element "&gt;
          &lt;div class="wpb_wrapper"&gt;
                      &lt;label&gt;Metodología&lt;/label&gt;
                      &lt;select name="metodologia" id="metodologia" class="metodologia"&gt;
                          &lt;option selected&gt;--Seleccione--&lt;/option&gt;
                          &lt;option value="PRESENCIAL" required&gt;Presencial&lt;/option&gt;
                          &lt;option value="VIRTUAL"&gt;Virtual&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;div id="ciudadDiv"&gt;
                      &lt;label&gt;Ciudad&lt;/label&gt;
                      &lt;select name="ciudad" id="ciudad"&gt;
                          &lt;option value="none" selected&gt;--Seleccione--&lt;/option&gt;
                          &lt;option value="MEDELLIN" required&gt;Medellín&lt;/option&gt;
                          &lt;option value="BOGOTA"&gt;Bogotá&lt;/option&gt;
                          &lt;option value="BARRANQUILLA"&gt;Barranquilla&lt;/option&gt;
                          &lt;option value="BUCARAMANGA"&gt;Bucaramanga&lt;/option&gt;
                          &lt;option value="MANIZALES"&gt;Manizales&lt;/option&gt;
                          &lt;option value="CALI"&gt;Cali&lt;/option&gt;
                      &lt;/select&gt;&lt;/div&gt;
                      &lt;label&gt;Programa&lt;/label&gt;
                      &lt;select name="programa" id="programa"&gt;
                          &lt;?php 
                          if($ciudad === "MEDELLIN"){ ?&gt;
                              &lt;option value="none" selected&gt;--Seleccione--&lt;/option&gt;
                              &lt;option value="none" selected&gt;PreUdeA&lt;/option&gt;
                              &lt;option value="none" selected&gt;PreUnal&lt;/option&gt;
                              &lt;option value="none" selected&gt;PreICFES Saber 11°&lt;/option&gt;
                              &lt;option value="none" selected&gt;PreMédico&lt;/option&gt;
                              &lt;option value="none" selected&gt;PreUdeA&lt;/option&gt;
                         &lt;?php }else{
                             echo $ciudad;
                         }
                                  ?&gt;
                      &lt;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="wpb_column vc_column_container vc_col-sm-6"&gt;&lt;div class="vc_column-inner "&gt;&lt;div class="wpb_wrapper"&gt;
      &lt;div class="wpb_text_column wpb_content_element "&gt;
          &lt;div class="wpb_wrapper"&gt;
                      &lt;label&gt;¿Cuando presentarás el examen?&lt;/label&gt;
                  &lt;select name="semestre" id="semestre"&gt;
                          &lt;option value="none" selected&gt;--Seleccione--&lt;/option&gt;
                          &lt;option value="2019-1" selected&gt;2019-1&lt;/option&gt;
                          &lt;option value="2019-2" selected&gt;2019-2&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;div id="jornadaDiv"&gt;
                          &lt;label&gt;Jornada&lt;/label&gt;
                  &lt;select name="jornada" id="jornada"&gt;
                          &lt;option value="none" selected&gt;--Seleccione--&lt;/option&gt;
                          &lt;option value="SEMANA" selected&gt;Semana&lt;/option&gt;
                          &lt;option value="FINDE" selected&gt;Fin de semana&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;/div&gt;
                  &lt;button type="submit" name="submit" value="Filtrar"&gt;Filtra tu programa&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>