How to send email verification code for a form?

You need to put together some php & db calls to handle the form submission, generate some unique code for each email and sending the verification code. Below I added a very basic example that can achieve that. It’s not a production ready code but tested and it works just fine. Firstly, you need to … Read more

Site Health and PHP 8.1

No, the constants WP_HOME and WP_SITEURL are not required to be defined. These constants would overwrite the URLs in the Settings > General fields, so for most sites they are undefined.

Strip and print only the numbers found in current’s post excerpt (even if they are without space)

If you have a strict list of allowed years: $allowed_years = array(‘2018’, ‘2019’, ‘2020’, ‘2021’, ‘2022’, ‘2023’, ‘2024’); Then why are you using regex when you can search for those years directly: function vyperlook_get_years_in_text( string $text, array $allowed_years ) : array { $found_years = []; // the years we found // for each year that … Read more