Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brandonjp/e1e31ef5367eea75f40c7595fb799e54 to your computer and use it in GitHub Desktop.
Save brandonjp/e1e31ef5367eea75f40c7595fb799e54 to your computer and use it in GitHub Desktop.
WP Settings: Set All Themes & Plugins to Auto-Update - Code Snippets Pro
<? // <- remove this line if you copy/paste into Code Snippets Pro
/**
* WP Settings: Set All Themes & Plugins to Auto-Update
*
* Set all themes and plug-ins to auto update.
* * Run only as needed
*/
namespace tOrGBs5p;
// For Themes
function get_all_theme_names(){
$all = \wp_get_themes();
return \array_keys($all);
}
\update_option( '\auto_update_themes', \tOrGBs5p\get_all_theme_names() );
// For Plugins
function get_all_plugin_names(){
$all = \get_plugins();
return \array_keys($all);
}
\update_option( '\auto_update_plugins', \tOrGBs5p\get_all_plugin_names() );
@brandonjp
Copy link
Author

PHP snippet for Code Snippets Pro
Set all themes and plug-ins to auto update.

  • Run only as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment