Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Enable automatic core updates #225

Open
domtra opened this issue Jun 15, 2017 · 2 comments
Open

Enable automatic core updates #225

domtra opened this issue Jun 15, 2017 · 2 comments
Assignees
Labels

Comments

@domtra
Copy link
Member

domtra commented Jun 15, 2017

it seems that there was a functionality change in wp 4.8.0.

I believe that it is possible to enable automatic minor updates to core while disallowing all other file modifications. This could have been possible before.

If we implement this, we should make sure that, if possible, it works for < 4.8.0 as well.

The code could be something like

add_filter('file_mod_allowed', function ($allow, $context) {
    if (in_array('context', ['automatic_updater', 'download_language_pack', 'can_install_language_pack']) {
        return true; // or return !FLYNT_DISALLOW_AUTO_UPDATE; or something
    } else {
        return $allow;
    }
}, 10, 2);

By default the auto core updater only updates minor versions. So no change is needed regarding that.

@domtra
Copy link
Member Author

domtra commented Jun 15, 2017

the old filter seems to have been disallow_file_mods. In this case the first argument would be $disallow instead of $allow, and the if clause would need to return false instead of true

@dgrdl dgrdl added the feature label Jun 15, 2017
@dgrdl
Copy link
Contributor

dgrdl commented Jun 15, 2017

👍 will take a look

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants