title: Pass extra parameters to usort callback
body: <p>I have the following functions. WordPress functions, but this is really a PHP question. They sort my <code>$term</code> objects according to the <code>artist_lastname</code> property in each object's metadata.</p>
  <p>I want to pass a string into <code>$meta</code> in the first function. This would let me reuse this code as I could apply it to various metadata properties.</p>
  <p>But I don't understand how I can pass <em>extra</em> parameters to the usort callback. I tried to make a JS style anonymous function but the PHP version on the server is too old (v. 5.2.17) and threw a syntax error.</p>
  <p>Any help - or a shove towards the right corner of the manual - gratefully appreciated. Thanks!</p>
  <pre><code>function sort_by_term_meta($terms, $meta) 
  {
    usort($terms,&quot;term_meta_cmp&quot;);
  }
  
  function term_meta_cmp( $a, $b ) 
  {
      $name_a = get_term_meta($a-&gt;term_id, 'artist_lastname', true);
      $name_b = get_term_meta($b-&gt;term_id, 'artist_lastname', true);
      return strcmp($name_a, $name_b); 
  }
  </code></pre>
  <p>PHP Version: 5.2.17</p>