[wp-hackers] How to determine which WordPress version is running ?
Per Soderlind
per at soderlind.no
Tue Jan 23 07:53:27 GMT 2007
I prefer to check for functionality instead for version. I also do that when
I code javascript, as recommended by pkk [1]
I ended up using: if (function_exists('wp_print_scripts')) {}
Kind regards,
Per
[1] http://www.quirksmode.org/js/support.html
On 2007-01-22, Robin Adrianse wrote:
> Yes, but it's useful for checking if the DB is at the version you need
> :). I would rely on $wp_version IMO.
>
> On 1/22/07, wordpress at nazgul.nu <wordpress at nazgul.nu> wrote:
>>
>> Keep in mind that the $wp_db_version doesn't always change with a
>> new release. The 2.0.3 and 2.0.4 releases shared the same db version
>> for instance.
>>
>> http://trac.wordpress.org/changeset/3825
>> http://trac.wordpress.org/changeset/4063
>>
>> Good catch.
>>
>>>>
>>>> Viper007Bond wrote:
>>>>> I find this to be best:
>>>>>
>>>>> global $wp_db_version;
>>>>> if ( 3664 <= $wp_db_version ) die('Your version is too low.');
>>>>> // Change the "3664" to whatever revision you wanna check for
>>>>>
>>>>>> Per Soderlind wrote:
>>>>>>> In my plugin, I need to determine which WordPress version
>>>>>>> it's
>>>>> installed
>>>>>> on.
>>>>>>> What is the best method for doing this ?
More information about the wp-hackers
mailing list