[wp-trac] [WordPress Trac] #10529: API to retrieve current WordPress version

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 1 10:47:39 UTC 2009


#10529: API to retrieve current WordPress version
---------------------------+------------------------------------------------
 Reporter:  stephanreiter  |       Owner:               
     Type:  enhancement    |      Status:  new          
 Priority:  normal         |   Milestone:  2.9          
Component:  Plugins        |     Version:               
 Severity:  minor          |    Keywords:  version query
---------------------------+------------------------------------------------

Comment(by dd32):

 php's version_compare() works well:

 {{{
 global $wp_version;
 if ( version_compare($wp_version, '2.8', '>=') ) {
 //2.8+ stuff here
 }
 }}}

 the good thing about this, is that it understands major, minor and point
 release, as well as dealing with -dev -alpha -etc.. nativly.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10529#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list