I was working on a project where I had to add the countries dropdown on the signup page. So, for making select dropdown countries selection sticky in the case of error at signup, I needed to check the $_POST[‘countries’] with every option in the select dropdown. It seems a redundant effort to me as It took me 30 mins to do this task.
So, I am sharing this code with you people to free you from this 30 mins hassle. In return all I need is a ‘Thank you’ !!!
Select Dropdown Countries Template for WordPress developers
This method is posted in our comments section.