title: wordpress custom post type search by meta key
body: <p>I have a custom post type MEMBER and there is a meta field member_name now I want search all member whose name start with 'S' . </p>
  
  <p>normal SQL : WHERE member_name like 'S%';</p>
  
  <h1>How can it be done in wordpress ?</h1>
  
  <p>What I did as bellow:</p>
  
  <pre><code> $arg = array(
                          'post_type' =&gt; 'member',
                          'post_status' =&gt; 'publish',
                          'order' =&gt; 'ASC',
                          'meta_key' =&gt; 'member_name',
                          'orderby' =&gt; 'meta_value',
                          'meta_query' =&gt; array(
                                                  array(
                                                       'key' =&gt; 'member_name',
                                                       'value' =&gt; $sort_by,
                                                       'compare' =&gt; 'LIKE'
                                                )
                                  )
                          );
  $wp_query = new WP_Query($arg);
  </code></pre>