PHP code example of wenprise / wp-meta-filter

1. Go to this page and download the library: Download wenprise/wp-meta-filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wenprise / wp-meta-filter example snippets


$deals = new Wenprise\MetaFilter\PostFilter();

$deals->set_post_type('client')
      ->set_meta_key('_deal_price')
      ->set_query_var('deal')
      ->set_header('成交金额大于')
      ->set_compare('>')
      ->set_options([
          0     => '0(已成交)',
          10000 => '10000 元',
          20000 => '20000 元',
      ]);