title: WP query - sort by meta_key if exist, else title
body: <p>I'm trying to get list of custom posts ordered by numeric meta_key first if such key exist, and than if there is no key, continue order by title.</p>
  
  <p>I mean:</p>
  
  <ol>
  <li>AObject (object_order => 1)</li>
  <li>FObject (object_order => 2)</li>
  <li>BObject (object_order => 3)</li>
  <li>AObject (object_order => NULL)</li>
  <li>BObject (object_order => NULL)</li>
  <li>CObject (object_order => NULL)
  ... and so on.</li>
  </ol>
  
  <p>I have such code:</p>
  
  <pre><code>$properties_for_map = array(
      'post_type' =&gt; 'property',
      'posts_per_page' =&gt; -1,
      'meta_key' =&gt; 'object_order',
      'orderby' =&gt; 'meta_value_num title',
      'order' =&gt; 'ASC',
      'tax_query' =&gt; $tax_query
  );
  </code></pre>
  
  <p>But it only showing post with meta key..
  I tried to find an answer on the site, and found some examples, but did not quite understand them. Maybe someone can help me and explain this method.</p>
  
  <p><strong>UPDATE 1:</strong>
  It can be done like this?</p>
  
  <pre><code>$properties_for_map = array(
      'post_type' =&gt; 'property',
      'posts_per_page' =&gt; -1,
          'meta_query'  =&gt; array(
      'relation' =&gt; 'OR',
      array(
          'key'     =&gt; object_order,
          'compare' =&gt; 'EXISTS',
      ),
      array(
          array(
              'key'   =&gt; object_order,
              'compare' =&gt; 'NOT EXISTS',
          ),
      ),
  ),
           'orderby' =&gt; array( 'meta_value_num' =&gt; 'ASC', 'title' =&gt; 'ASC' ),
      'tax_query' =&gt; $tax_query
  );
  </code></pre>