• Resolved Ivan Privalov

    (@ivanpr)


    Hello, I am trying to filter the output with the BETWEEN compare factor via:

    …&csrp_meta_key=price&csrp_meta_compare=BETWEEN&csrp_meta_value=100,500

    Is that a proper way of doing it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ivan Privalov

    (@ivanpr)

    The WordPress requires the BETWEEN values to be sent as an array.

    I therefore modified the call to:
    &csrp_meta_key=price&csrp_meta_compare=BETWEEN&csrp_meta_value=100,500&csrp_meta_type=ARRAY

    and adjusted the custom-simple-rss.php code:

    	if( isset($_GET["csrp_meta_type"]) ){
    		$csrp_meta_type = sanitize_text_field($_GET["csrp_meta_type"]);	
    	}else{
    		$csrp_meta_type = 'CHAR';	
    	}

    TO:

    	if( isset($_GET["csrp_meta_type"]) ){
    		$csrp_meta_type = sanitize_text_field($_GET["csrp_meta_type"]);
    		if($csrp_meta_type == "ARRAY") {
    			$csrp_meta_type		= 'numeric';
    			$csrp_meta_value	= explode(',', $csrp_meta_value);
    		}
    	}else{
    		$csrp_meta_type = 'CHAR';
    	}
    Plugin Author danikoo

    (@danikoo)

    Thanks Ivan
    I’ll check it out and apply the fix to the next version

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Meta-data criteria with BETWEEN’ is closed to new replies.