Created
January 18, 2023 23:23
-
-
Save brandonjp/e1e31ef5367eea75f40c7595fb799e54 to your computer and use it in GitHub Desktop.
WP Settings: Set All Themes & Plugins to Auto-Update - Code Snippets Pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? // <- 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() ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PHP snippet for Code Snippets Pro
Set all themes and plug-ins to auto update.