title: Get tag name and tag slug after creating tag in Wordpress
body: <p>I want to get <strong>tag name</strong> and <strong>tag slug</strong> after creating a tag in Wordpress.</p>
  
  <p>I have done this in <code>function.php</code>, its working but it just returns <code>"post_tag"</code> in <code>$tags</code>, and I need to create tag name and slug in return or by any other method.</p>
  
  <p>Any kind of help is appreciated.</p>
  
  <pre><code>function update_tags($tags) {
      $data = array("name" =&gt; $tags-&gt;name,"slug" =&gt; $tags-&gt;slug,); 
  
      $data_string = json_encode($data);                                                                                   
  
      $ch = curl_init('APIURL');                                                                      
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
      curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
          'Content-Type: application/json',                                                                                
          'Content-Length: ' . strlen($data_string))                                                                       
      );                                                                                                                   
  
      $result = curl_exec($ch);
  }
  add_action( 'post_tag_add_form', 'update_tags',10 ,1 );
  </code></pre>