WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#49626 new feature request

Allow plugin developers to opt-out their plugin from auto updates

Reported by: JaworskiMatt Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:

Description

I would like to request a filter for plugin developers to be able to opt their plugin out from the automatic updates completely.

For example in wp_autoupdates_add_plugins_autoupdates_column_content we could add something like

<?php
if ( !apply_filters('wp_autoupdates_enabled_for_plugin', TRUE, $plugin_file)) {
    return;
}

This way a developer of a plugin that for some reason should always be updated manually, can hide this option from the admin for his own good.

Change History (1)

#1 @TimothyBlynJacobs
4 weeks ago

Thanks for your ticket @JaworskiMatt!

I think there is a filter that would already be usable for this purpose: `auto_update_{$type}`.

<?php
add_filter( 'auto_update_plugin', function ( $update, $item ) {
        if ( $item->plugin === 'your-plugin/your-file.php' ) {
                return false;
        }

        return $update;
}, 10, 2 );
Note: See TracTickets for help on using tickets.