Anonymous functions usage
<p>Just wondering what the preferred method of using anonymous functions is.</p>

<p>First I had some code like this:</p>

<pre><code>function page_columns( $columns ) {
    $columns = array(
        'cb' =&gt; '&lt;input type="checkbox" /&gt;',
        'title' =&gt; 'Title',
        'author' =&gt; 'Author',
        'template' =&gt; 'Template',
        'date' =&gt; 'Date'
    );

    return $columns;
}
add_filter('manage_edit-page_columns', 'page_columns');
</code></pre>

<p>But I know WordPress discourages using variables for things that will only be used once so I switched it to</p>

<pre><code>function page_columns( $columns ) {
    return array(
        'cb' =&gt; '&lt;input type="checkbox" /&gt;',
        'title' =&gt; 'Title',
        'author' =&gt; 'Author',
        'template' =&gt; 'Template',
        'date' =&gt; 'Date'
    );
}
add_filter('manage_edit-page_columns', 'page_columns');
</code></pre>

<p>But now I'm thinking why even use a function at all?</p>

<pre><code>add_filter('manage_edit-page_columns', function(){
    return array(
        'cb' =&gt; '&lt;input type="checkbox" /&gt;',
        'title' =&gt; 'Title',
        'author' =&gt; 'Author',
        'template' =&gt; 'Template',
        'date' =&gt; 'Date'
    );
});
</code></pre>

<p>What is the preferred method? Any reason why? Perhaps update the <a href="http://codex.wordpress.org/WordPress_Coding_Standards" rel="nofollow">WordPress Coding Standards</a>?</p>
