[wp-hackers] how to use wp_version_check() function?

Konrad Karpieszuk kkarpieszuk at gmail.com
Mon Sep 14 21:09:15 UTC 2009


ooook :) so now i understand :) so if i want to check which version i have,
i need to do this piece of code:
// it takes all information:
$update_core = get_transient('update_core');
// it takes information sent from wordpress server:
$za = $update_core->updates;
// it takes information about version with locale same as out (eg pl_PL)
$zb = $za[0];
// and it takes info which version we have comparing to server version
$zm = $zb->response;
// return: "latest" for latest, "upgrade" if we have too old version and
"development" if we have for example wordpress 12.4.2 ;)
echo $zm;

it's not a question :) i checked and it works, but i wrote those obvious
things for people who will google this email ;)

On Mon, Sep 14, 2009 at 9:46 PM, Otto <otto at ottodestruct.com> wrote:

> wp_version_check() performs the version check, and then sets the
> update_core transient if there's a new version. It doesn't return
> anything of value.
>
> Basically, WordPress checks for updates all by itself. All you have to
> do is to do a get_transient( 'update_core' ) and then, when it
> changes, it'll have information about a new version in it which you
> can use to send the email.
>
> -Otto
>
>
>
> On Mon, Sep 14, 2009 at 2:30 PM, Konrad Karpieszuk
> <kkarpieszuk at gmail.com> wrote:
> > hello :)
> > I am this guy who created few days ago plugin to notify by email if new
> > version of wordpress is available.
> >
> http://www.muzungu.pl/moje-pluginy-do-wordpressa/upgrade-notification-by-email/
> >
> > in many places (eg
> http://www.wptavern.com/upgrade-notifications-by-email )
> > you suggest me to use function wp_version_check() but i don't know how to
> do
> > this :(
> >
> > i found its description in update.php file but i still dont know how to
> use
> > it. i see that i return false or null. ok, but what it returns else?
> >
> > could anyone axplain me how to check if new version of wordpress is
> > available using this function and if it is available perform some action
> > (for example print "is available")?
> >
> > i tried to use this function in template file footer.php. i putted there:
> >
> > <?php  if (wp_version_check()) { print "OK"; } else {print "not ok"; }
> ?>
> >
> > and it prints "not ok" at wordpress 2.8.1 and at 2.8.4. so result is
> thesame
> > on not actual and actual version of wordpress :(
> >
> > --
> > (en) regards / (pl) pozdrawiam
> > Konrad Karpieszuk
> > http://konradjestwrwandzie.wordpress.com/
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
(en) regards / (pl) pozdrawiam
Konrad Karpieszuk
http://konradjestwrwandzie.wordpress.com/


More information about the wp-hackers mailing list