[wp-trac] [WordPress Trac] #52963: Could use a Helper Function for Auto-Updates

WordPress Trac noreply at wordpress.org
Fri Apr 2 19:38:31 UTC 2021


#52963: Could use a Helper Function for Auto-Updates
-----------------------------+-----------------------------
 Reporter:  circlecube       |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  5.7
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Would be nice to have a helper function (for example
 `does_plugin_auto_update`) to check if a plugin has auto-updates enabled.
 Currently the plugins are listed as an array in `auto_update_plugins` in
 the options table. It's not too tricky to grab the array and check if a
 plugin is listed,

 {{{#!php
 <?php
 // check core setting for auto updates on a plugin
 $auto_update_plugins = (array) get_site_option( 'auto_update_plugins',
 array() );
 if ( in_array( 'hello-dolly', $auto_update_plugins, true ) ) {
         // do something
 }
 }}}

 but would be ideal to have a helper do this
 {{{#!php
 <?php
 if ( does_plugin_auto_update( 'hello-dolly' ) ) {
         // do something
 }
 }}}
 much like the current `is_plugin_active` etc.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52963>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list