title: PHP array syntax (Hacking a wordpress plugin)
body: <p>I know it's not the best practice, but currently hacking at the Wordress Plugin 'Facet WP' to include some custom functionality. All has been working fine, however I've hit an issue with my understanding concerning PHP syntax.</p>
  
  <p>How do I include my query arguments</p>
  
  <pre><code>            'query_args' =&gt; array(
                  'meta_key' =&gt; '_custom_post_meta',
                  'orderby'           =&gt; 'meta_value_num',
                  'order' =&gt; 'ASC',
              )
  </code></pre>
  
  <p>in the form of:</p>
  
  <pre><code>           $this-&gt;query_args['orderby'] = 'post__in';
  </code></pre>
  
  <p>I'm unfamiliar with the different ways of writing arrays.</p>
  
  <p>The context is that I'm improving the onload search 'default' sort to immediately sort by my custom post meta, rather than but the Wordpress 'post__in' method (which sorts by ascending post IDs).</p>
  
  <p>Thanks.</p>
  
  <p>Edit with more code?</p>
  
  <p>A basic version of the full search</p>
  
  <p>function get_sort_options() {</p>
  
  <pre><code>      $options = array(
              'default' =&gt; array(
                  'label' =&gt; __( 'Sort by', 'fwp' ),
                  'query_args' =&gt; array()
              ),
  )
  </code></pre>
  
  <p>The current full 'default' results sort.</p>
  
  <pre><code>  // Sort the results by relevancy
          if ( $this-&gt;is_search &amp;&amp; 'default' == $sort_value ) {
               $this-&gt;query_args['orderby'] = 'post__in';
          }
  </code></pre>
  
  <p>My desired query arguments for the latter:</p>
  
  <pre><code>'meta_key' =&gt; '_custom_post_meta'
  'orderby' =&gt; 'meta_value_num'
  'order' =&gt; 'ASC'
  </code></pre>