title: How to make wordpress admin menu collapsed by default?
body: <p>I hope you all have seen wordpress admin panel. We have option at the end of menu to collapse or expand the menu.</p>
  
  <p>If you click on collapse the menu gets collapsed and that settings gets saved ( I don't know where ) but if you login again you will see the same collapsed menu.. </p>
  
  <p>Where are they storing that data ??? 
  I want to make admin menu to be shown collapsed by default how do i do that ?</p>
  
  <p>Edit : I think the file wp-admin/js/common.js is responsible for that.. 
  you can view the file here <a href="http://phpcrossref.com/xref/wordpress/wp-admin/js/common.js.txt" rel="nofollow noreferrer">http://phpcrossref.com/xref/wordpress/wp-admin/js/common.js.txt</a></p>
  
  <p>I think I got the code which is responsible for that, but I am new to js. The code is as follows : </p>
  
  <pre><code>$('#collapse-menu').on('click.collapse-menu', function() {
      var body = $( document.body ), respWidth, state;
  
      // reset any compensation for submenus near the bottom of the screen
      $('#adminmenu div.wp-submenu').css('margin-top', '');
  
      if ( window.innerWidth ) {
          // window.innerWidth is affected by zooming on phones
          respWidth = Math.max( window.innerWidth, document.documentElement.clientWidth );
      } else {
          // IE &lt; 9 doesn't support @media CSS rules
          respWidth = 961;
      }
  
      if ( respWidth &amp;&amp; respWidth &lt; 960 ) {
          if ( body.hasClass('auto-fold') ) {
              body.removeClass('auto-fold').removeClass('folded');
              setUserSetting('unfold', 1);
              setUserSetting('mfold', 'o');
              state = 'open';
          } else {
              body.addClass('auto-fold');
              setUserSetting('unfold', 0);
              state = 'folded';
          }
      } else {
          if ( body.hasClass('folded') ) {
              body.removeClass('folded');
              setUserSetting('mfold', 'o');
              state = 'open';
          } else {
              body.addClass('folded');
              setUserSetting('mfold', 'f');
              state = 'folded';
          }
      }
  
      $( document ).trigger( 'wp-collapse-menu', { state: state } );
  });
  </code></pre>