title: How to hide Wordpress widget ID programmatically
body: <p>Based on a particular value(appID) I want to hide one of the widget ID in my wordpress blog.</p>
  
  <p>my widget Id : <strong>custom_html-2</strong>  ( I got this value from enabling accessibility mode) 
  ( from this url I got widgetID : <code>/wp-admin/widgets.php?widgets-access=on&amp;_wpnonce=0b123456fb2&amp;editwidget=custom_html-2&amp;sidebar=right-sidebar&amp;key=0</code> )</p>
  
  <p>Here I want to hide <strong>custom_html-2</strong>  when the value of appID is <strong>in.abcd.app</strong> .</p>
  
  <p>I just <strong>echoed appID</strong> , I am getting the value <strong>in.abcd.app</strong> , but the widget is not getting hidden.</p>
  
  <p>I opened the Sidebar (sidebar.php) in the word press and did modification as bellow. Didnt workout - I am new to wordpress and PHP</p>
  
  <pre><code>&lt;!-- Sidebar --&gt;
  &lt;div class="col-lg-4 col-md-4 col-sm-4"&gt;
  
      &lt;aside class="sidebar"&gt;
  
          &lt;?php if ( is_active_sidebar( 'right-sidebar' ) ) : ?&gt;
          &lt;div class="sidebar-widget"&gt;
  
              &lt;?php dynamic_sidebar( 'right-sidebar' ); ?&gt;
  
              &lt;?php   
                  &lt;?php $widgets  = get_option('widget'.sidebar-widget); ?&gt;
                  $appID =  $_SERVER['HTTP_X_REQUESTED_WITH'] 
                  if ($appID = 'in.abcd.app')
                  {
                  &lt;?php unset($widgets['custom_html-2']); ?&gt;
              ?&gt;
  
  
          &lt;/div&gt;
          &lt;?php endif; ?&gt;
  
      &lt;/aside&gt;
  
  &lt;/div&gt;
  &lt;!-- /end sidebar --&gt;
  </code></pre>