lausha (April 26th, 2011)
function sql_restrict($where){ if($this->isPosted()){ global $wpdb; /** This could possibly be considered invasive, need to think this bit through * properly. */ $where = preg_replace("_AND\s*\(ID\s*=\s*'\d+'\)_","",$where); $where = preg_replace("/AND $wpdb->posts.post_type = '(post|page)'/","",$where); $where.= " AND ($wpdb->posts.post_type='ad_listing')"; foreach($this->getInputs($_REQUEST['widget_number']) as $input){ $where = $input->sql_restrict($where); } } return $where; }
lausha (April 26th, 2011)
There are currently 1 users browsing this thread. (0 members and 1 guests)