Ejemplo n.º 1
0
 public function search_the_posts($s, $post_type)
 {
     $args = array('s' => $s, 'post_type' => $post_type);
     $q = WP_Query($args);
     return $q;
 }
Ejemplo n.º 2
0
function my_ajax_callback_function()
{
    // Implement ajax function here
    if ($_GET['first']) {
        $first = $_GET['first'];
    }
    if ($_GET['second']) {
        $second = $_GET['second'];
    }
    $args = array('posts_per_page' => -1, 'post_type' => 'product', 'meta_query' => array(array('key' => '_regular_price', 'value' => array($first, $second), 'compare' => 'BETWEEN', 'type' => 'DECIMAL')));
    WP_Query($args);
}