Get the selected term in a dropdown search
To show dropdown with currently selected option, first you need to fetch current value. You can get that value from $_REQUEST variable. If you have grade variable then your current value is $_REQUEST[‘grade’]. Eg. if ($_REQUEST[‘grade’] == $term->slug) Recommended: Do not use REQUEST variable directly without sanitization. Use function like esc_attr. If you are sure … Read more