Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Add a text input field to Ultimate WP Query Search Filter WordPress

  • SOLVED

Note** I'll increase the bid to $10 if anyone has a solution.

This plugin currently has the dropdown/radio/checkbox but for some reason they did not included text filed I need a text filed.

http://wordpress.org/support/view/plugin-reviews/ultimate-wp-query-search-filter

Also I need to rearrange the fields position so it should be

SKU: (**a text field)
Then default keywords filed
Then default category field

and 3 other fields no changes required

You can see the plugin on my site:
http://dev15.jihan.me/wp-admin
user: admin
pass: DxZ379^^s



Answers (1)

2014-02-02

Ryan S answers:

To add a new field open ultimate-wp-query-search-filter/classes/uwpqsf-base-class.php and update

from

function utaxo_display(){
$fields = array('dropdown' => 'Drop Down', 'radio' => 'Radio', 'checkbox' => 'Check Box');
$output = apply_filters( 'uwpqsftaxo_field', $fields );
return $output;
}


to


function utaxo_display(){
$fields = array('dropdown' => 'Drop Down', 'radio' => 'Radio', 'checkbox' => 'Check Box', 'text' => 'Text Field');
$output = apply_filters( 'uwpqsftaxo_field', $fields );
return $output;
}


That is adding option in admin panel

And for front-end open /classes/uwpqsf-front-class.php
and add the ff. in output_formcmf_fields(){}

if($type == 'text'){
$html = '<div class="'.$defaultclass.' '.$divclass.' cmf-text-'.$i.'"><span class="cmflabel-'.$i.'">'.$label.'</span>';
$html .= '<input type="hidden" name="cmf['.$i.'][metakey]" value="'.$metakey.'">';
$html .= '<input type="hidden" name="cmf['.$i.'][compare]" value="'.$compare.'">';
if(!empty($all)){
$html .= '<label><input type="text" id="cmf-'.$i.'" name="cmf['.$i.'][value]" value="uwpqsfcmfall">'.$all.'</label>';
}

foreach ( $opts as $opt ) {
$val = explode('::',$opt);
$html .= '<label><input type="text" id="cmf-'.$i.'" name="cmf['.$i.'][value]" value="'.$val[0].'" >'.$val[1].'</label>';
}
$html .= '</div>';

return apply_filters( 'uwpqsf_cmf_field_text', $html,$type,$metakey,$compare,$metaval,$label,$all,$i,$defaultclass,$id,$divclass);
}



Hope that helps


Jihan Ahmed comments:

its displaying in the admin properly but u missed one thing the text filed should be in Add Meta Field not in taxanomy and for example I should be able to select a custom filed for this.


Ryan S comments:

Please increase the price so I can update and provide you more customisation, $1 is really not enough for plugin customisation.


Jihan Ahmed comments:

Hello, The actual bid is $10 but I just do not want to submit fund and go through refund if someone is not able to solve but as you are close so I want to go with you. Let me know when you are online I'll update it to $10


Ryan S comments:

Same file in the above class, update this function

from

function ucmf_display(){
$fields = array('dropdown' => 'Drop Down', 'radio' => 'Radio', 'checkbox' => 'Check Box');
$output = apply_filters( 'uwpqsfcmf_field', $fields );
return $output;
}


to

function ucmf_display(){
$fields = array('dropdown' => 'Drop Down', 'radio' => 'Radio', 'checkbox' => 'Check Box', 'text' => 'Text Field');
$output = apply_filters( 'uwpqsfcmf_field', $fields );
return $output;
}



Hope that helps


Jihan Ahmed comments:

sorry but your filed is not functioning .. check it here http://dev13.jihan.me/search/ select product cat: Diamond and Precious Jewelery

and give any sku it brings the result without considering sku.. in the backend I have given it meta key _sku and the logic is set to AND

What should I do now? I can setup test site for you if you want to test codes.


Ryan S comments:

Yeah that would be great, just send me info in private message.