[wp-trac] [WordPress Trac] #30499: define WP_VERSION, to prevent having to code around plugins which change $wp_version

WordPress Trac noreply at wordpress.org
Thu Dec 11 00:05:06 UTC 2014


#30499: define WP_VERSION, to prevent having to code around plugins which change
$wp_version
---------------------------+------------------------------
 Reporter:  DavidAnderson  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by stevegrunwell):

 I agree that this constant would be useful (as the version shouldn't need
 to be able to change), but I question whether or not it makes sense to add
 without actually combing through core and using `WP_VERSION` instead of
 the current `$wp_version` global (though the global might need to stick
 around for legacy reasons). At the very least, it would probably make more
 sense to add it to wp-load.php just after version.php is included (to keep
 that file clean):
 {{{
   define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
   require_once( ABSPATH . WPINC . '/version.php' );
 + define( 'WP_VERSION', $wp_version );

   wp_check_php_mysql_versions();
 }}}
 The case you've described seems like a major edge-case: the site needs to
 load the (accurate) WordPress version yet is running a disruptive plugin
 like the one you mentioned? Wouldn't the simplest path be to a) create the
 constant yourself before plugins are loaded or b) not use plugins like
 that as they could have serious repercussions on things like core upgrades
 and caching?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30499#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list