[wp-hackers] How to determine which WordPress version is running ?

Viper007Bond viper at viper007bond.com
Tue Jan 23 13:13:19 GMT 2007


But what if you aren't looking for a function and instead something like a
hook? ;)

On 1/22/07, Per Soderlind <per at soderlind.no> wrote:
>
> 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 ?
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/


More information about the wp-hackers mailing list