Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* POST TYPES */
- if((isset($_POST[SF_FPRE.'post_types']))&&($this->has_form_posted))
- {
- $the_post_types = ($_POST[SF_FPRE.'post_types']);
- //make the post an array for easy looping
- if(!is_array($the_post_types))
- {
- $post_types_arr[] = $the_post_types;
- }
- else
- {
- $post_types_arr = $the_post_types;
- }
- $num_post_types = count($post_types_arr);
- for($i=0; $i<$num_post_types; $i++)
- {
- if($post_types_arr[$i]=="0")
- {
- $post_types_arr[$i] = "all";
- }
- }
- if(count($post_types_arr)>1)
- {
- $operator = ","; //default behaviour
- //check to see if an operator has been specified - only applies with fields that use multiple selects such as checkboxes or multi selects
- /*if(isset($_POST[SF_FPRE.'post_types_operator']))
- {
- if($_POST[SF_FPRE.'post_types_operator']=="and")
- {
- $operator = "+";
- }
- else if($_POST[SF_FPRE.'post_types_operator']=="or")
- {
- $operator = ",";
- }
- else
- {
- $operator = "+";
- }
- }*/
- $post_types = implode($operator,$post_types_arr);
- if(!$this->hasqmark)
- {
- $this->urlparams .= "?";
- $this->hasqmark = true;
- }
- else
- {
- $this->urlparams .= "&";
- }
- $this->urlparams .= "post_types=".$post_types;
- }
- else
- {
- $operator = ","; //default behaviour
- $post_types = implode($operator,$post_types_arr);
- if(!$this->hasqmark)
- {
- $this->urlparams .= "?";
- $this->hasqmark = true;
- }
- else
- {
- $this->urlparams .= "&";
- }
- $this->urlparams .= "post_type=".$post_types;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement