[wp-hackers] minimum version

Mark E mark at simplercomputing.net
Wed Sep 8 01:16:32 UTC 2010


On 09/07/2010 05:48 PM, Ryan Bilesky wrote:
 > Is there an easy trick to figure out what the minimum version of
 > wordpress my plugin will work with?

On a related note, and just for sake of reference, devs can put 
something like this code snippet below in their code to make sure 
someone isn't running a version of WP that definitely won't work with a 
plugin, or theme:

------------------------
global $wp_version;

if ( !version_compare( $wp_version, "2.9", ">" ) ) {

     echo '<div style="width:100%; background-color: #cf0000; 
text-align:center; color:#fff; font-style: italic; font-weight: 
bold;font-size: 14px; padding: 4px 0">';

     _e('The XYZ123 Plugin/Theme requires WordPress version 2.9 or 
newer. <a style="color:#fff !important" 
href="http://codex.wordpress.org/Upgrading_WordPress" 
target="_blank">Please upgrade!</a>', $this->localization_domain);

     echo '</div>';

}
---------------------------

Mark





More information about the wp-hackers mailing list