[wp-trac] [WordPress Trac] #19790: function request : is_plugin_latest($plugin);

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 9 20:23:12 UTC 2012


#19790: function request : is_plugin_latest($plugin);
-----------------------------+-----------------------------
 Reporter:  nohalfpixels     |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Plugins          |    Version:  3.3.1
 Severity:  minor            |   Keywords:
-----------------------------+-----------------------------
 i am working on a plugin right now an i am at the stage of adding help
 content to it.

 i want to be able to display a contact form for support, but only want
 this to show if the user makes sure they are using the latest plugin
 version.

 ive searched the core and the codex and i cant find any function that
 "just" checks if a plugins up to date (i know wordpress does check, but it
 wrapped up in bigger proccesses).


 this would also be usefull to check themes as well, but for now maybe just
 a plugin version check.


 it seems simple enough by just checking the site transient for plugins and
 checking the response array. if theres a better solution please let me
 know, because the code below is what i use currently in every plugin of
 mine:


 {{{
 function _is_latest($plugin){

                 $info = get_site_transient( 'update_plugins' );

                 if(isset($info->response[$plugin]['new_version'])){
                         return false;
                 }else{
                         return true;
                 }//if


 }//function
 }}}




 this is really simple, could we get it added to the core?

 for themes we could just add a context arg to the funtion like
 {{{
 _is_latest($context, $file);
 }}}

 and call either the theme or plugin transient based on value of $context

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19790>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list