I am looking for a way to change how we make sure that WordPress and its components are kept up to date. Minor and major core updates, updates of themes plugins translation files and disabling the respective email notifications is done via the respective filters in a mu\_plugin.
Alternatives readily available are to do this in plugins of varying sophistication: from plugins that also just have those filters, via plugins that have their own options and use those filters according to those, to plugins that are a lot more complex and substitute the default update handling.
I’d prefer to just set the options and let WordPress itself do the rest. After all, for some of those updates you can decide to have it either way.
To get an overview, consider the following table, I’ll explain after it:
|*filter*|*desired return*|*origin*|
|:-|:-|:-|
|allow\_minor\_auto\_core\_updates|\_\_return\_true|auto\_update\_core\_minor = enabled|
|allow\_major\_auto\_core\_updates|\_\_return\_true|auto\_update\_core\_major = enabled|
|auto\_update\_theme|\_\_return\_true|???|
|auto\_update\_plugin|\_\_return\_true|auto\_update\_plugins = ??? → a:0:{}|
|auto\_update\_translation|\_\_return\_true|???|
|auto\_core\_update\_send\_email|\_\_return\_false|???|
|auto\_plugin\_update\_send\_email|\_\_return\_false|auto\_plugin\_theme\_update\_emails = ??? → a:0:{}|
|auto\_theme\_update\_send\_email|\_\_return\_false|auto\_plugin\_theme\_update\_emails = ??? → a:0:{}|
My thought process goes like this:
Take `allow_minor_auto_core_updates` for example. If we filter it we basically force that to be considered as set to true (well, “enabled”). But without filtering it still is set to some value. Either by default (non-existant option considered true/false) or because a value exists (option auto\_update\_core\_minor set to “enabled” in wp\_options) in wp\_options.
In the column *origin* are my findings. As per the example, if `auto_update_core_minor`’s value is the string “enabled” it will have the same effect as `add_filter( ‘allow_minor_auto_core_updates’, ‘__return_true’ );` For `auto_update_theme` I can’t find a corresponding option. For `auto_update_plugins` I think I can, but I’m baffled by it being an empty array which I have no idea what to change it to to get the desired outcome.
I’ll be blunt: If somebody in the know can tell me what options I need to set to which values, I’d appreciate it. I have scoured the WordPress source code to varying extent and success but I think for once, this might be a rabbit hole slightly too deep for me 🙂
[ad_2]