if ($type == 'form') { parse_str($_POST['getcmfdata'], $getdata); $metakey = isset($getdata['prekey']) ? sanitize_text_field($getdata['prekey']) : ''; $label = isset($getdata['precmflabel']) ? sanitize_text_field($getdata['precmflabel']) : ''; $all = isset($getdata['precmfall']) ? sanitize_text_field($getdata['precmfall']) : ''; $com = isset($getdata['precompare']) ? sanitize_text_field($getdata['precompare']) : ''; $check = isset($getdata['cmfdisplay']) ? sanitize_text_field($getdata['cmfdisplay']) : ''; $option = isset($getdata['preopt']) ? sanitize_text_field($getdata['preopt']) : ''; $c = isset($_POST['cmfcounter']) ? sanitize_text_field($_POST['cmfcounter']) : ''; $campares = $classapi->cmf_compare(); echo '<div id="dragbox" ><h3><div class="toggle2 plus"></div>' . $label . '<a href="" class="removediv">Remove</a></h3>'; echo '<div class="cmfdragbox" style="display:none">'; echo '<input type="hidden" id="cmfcounter" value=' . $c . '>'; //meta key echo '<p><span><b>' . __("Meta Key", "UWPQSF") . '</b></span><br>'; $keys = $classapi->get_all_metakeys(); echo '<select id="cmfkey" name="uwpname[cmf][' . $c . '][metakey]">'; foreach ($keys as $key) { $selected = $metakey == $key ? 'selected="selected"' : ''; echo '<option value="' . $key . '" ' . $selected . '>' . $key . '</option>'; } echo '</select>'; echo '</p>'; //for Label echo '<p><span><b>' . __("Label", "UWPQSF") . '</b></span><br>'; echo '<input type="text" id="cmflabel" name="uwpname[cmf][' . $c . '][label]" value="' . sanitize_text_field($label) . '"/>'; echo '</p>'; //search all text echo '<p><span><b>' . __("Text For 'Search All' Options", "UWPQSF") . '</b></span><br>'; echo '<input type="text" id="cmfalltext" name="uwpname[cmf][' . $c . '][all]" value="' . sanitize_text_field($all) . '"/>'; echo '</p>';
$html .= '<p><label>' . __("Label for string search.", "UWPQSF") . ':</label><br>'; $html .= '<input type="text" name="uwpname[rel][0][strlabel]" id="stringlabel" value="' . $slabel . '" /><br></p>'; $html .= '<p><input ' . $snf . ' name="uwpname[rel][0][snf]" type="checkbox" value="1" />' . __("Combine string search with filters above", "UWPQSF") . '</p>'; $api = new uwpqsfclass(); $orderbys = $api->orderby_options(); $html .= '<h3>' . __("Result Page Setting", "UWPQSF") . '</h3>'; $html .= '<p><label>' . __("Orderby", "UWPQSF") . ':</label><br>'; $html .= '<select name="uwpname[rel][0][otype]" class="uorderby">'; foreach ($orderbys as $k => $v) { $select = $ordertype == $k ? 'selected="selected"' : ''; $html .= '<option value="' . $k . '" ' . $select . '>' . $v . '</option>'; } $html .= '</select><br>'; $html .= '<span class="desciption">' . __("Sort retrieved posts by parameter. For Meta Value or Numeric Meta Value, must insert Sorting Meta Key below.", "UWPQSF") . '</span></p>'; $html .= '<p><label>' . __("Sorting Meta Key.", "UWPQSF") . ':</label><br>'; $keys = $api->get_all_metakeys(); $html .= '<select name="uwpname[rel][0][smetekey]" id="ormkey" ' . $incative . '><option value=""></option>'; foreach ($keys as $key) { $selected = $meta == $key ? 'selected="selected"' : ''; $html .= '<option value="' . $key . '" ' . $selected . '>' . $key . '</option>'; } $html .= '</select><br>'; $html .= '<span class="desciption">' . __("Insert the meta key that will be used for the result sorting. The meta key must also be present in the query.", "UWPQSF") . '</span></p>'; $html .= '<p><label>' . __("Sorting Order", "UWPQSF") . ':</label><br>'; $html .= '<label><input ' . $desc . ' type="radio" id="taxhide" name="uwpname[rel][0][sorder]" value="DESC"/>' . __("Descending", "UWPQSF") . '</label>'; $html .= '<label><input ' . $asc . ' type="radio" id="taxhide" name="uwpname[rel][0][sorder]" value="ASC"/>' . __("Ascending", "UWPQSF") . '</label><br>'; $html .= '<span class="desciption">' . __("The search result sorting order. Default is descending", "UWPQSF") . '</span></p>'; $html .= '<p><label>' . __("Results per Page", "UWPQSF") . ':</label>'; $html .= '<input type="text" id="numberpost" name="uwpname[rel][0][resultc]" value="' . $result . '" size="2"/><br>'; $html .= '<span class="desciption">' . __("How many posts shows at each result page?", "UWPQSF") . '</span></p>'; $html .= '<p><label>' . __("Search Button Text", "UWPQSF") . ':</label>';