Changes between Version 2 and Version 3 of Ticket #19503
- Timestamp:
- 12/10/11 17:23:58 (18 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19503 – Description
v2 v3 1 Problem: 1 '''Problem:''' 2 2 3 3 Plugin/theme authors cannot reliably use $wp_version when doing their own feature development without hitting a chicken-egg scenario. 4 4 5 Example: 5 ---- 6 7 '''Example:''' 6 8 7 9 I want a plugin to call function foo_32() for all major WordPress 3.2 branch versions. 10 8 11 I want a plugin to call function foo_33() for all major WordPress 3.3 branch versions. 9 12 10 version_compare() is inadequate for this when used in conjunction with WordPress core's versioning scheme: 13 3.2.1 is greater than 3.2 11 14 12 3.2.1 is greater than 3.213 15 3.3-RC2 is less than 3.3 14 16 15 Paradox: 17 version_compare() is inadequate for this when used in conjunction with core's versioning scheme. 18 19 ---- 20 21 '''Paradox:''' 16 22 17 23 version_compare( '3.2', $wp_version ); -- Fails when 3.2.1 comes out 24 18 25 version_compare( '3.3', $wp_version ); -- Fails before 3.3 is released 19 26 20 27 Using version_compare() with any combination of operators yields the same result. 21 28 22 Proposed Solution: 29 ---- 30 31 '''Proposed Solution:''' 23 32 24 33 A new global: $wp_major_version
