WordPress Code Snippets

A fresh mix of code snippets and tutorials

WordPress Check PHP Version


When working with the WP API, you may need to check the current version of PHP to ensure compatibility.

This code snippet uses PHP’s version_compare() function and predefined PHP_VERSION constant. You can use this technique in any WordPress theme or plugin to determine whether or not the current version of PHP meets current WordPress minimum requirements (currently PHP v5.6). See references below.


Learn more

WordPress Themes In Depth

Show Support

Like our new Facebook Page to show support!