title: Anonymous functions in WordPress hooks
body: <p>WordPress hooks can be used in two ways:</p>
  
  <ol>
  <li><p>using callback function name and appropriate function</p>
  
  <pre><code>add_action( 'action_name', 'callback_function_name' );
  function callback_function_name() {
      // do something
  }
  </code></pre></li>
  <li><p>using anonymous function (closure)</p>
  
  <pre><code>add_action( 'action_name', function() {
      // do something
  } );
  </code></pre></li>
  </ol>
  
  <p>Is there any difference for WordPress what way to use? What is prefered way and why?</p>