wp_is_auto_update_enabled_for_type

The timeline below displays how wordpress function wp_is_auto_update_enabled_for_type has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Checks whether auto-updates are enabled.
 *
 * @since 5.5.0
 *
 * @param string $type The type of update being checked: Either 'theme' or 'plugin'.
 * @return bool True if auto-updates are enabled for `$type`, false otherwise.
 */
function wp_is_auto_update_enabled_for_type($type)
{
    if (!class_exists('WP_Automatic_Updater')) {
        require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
    }
    $updater = new WP_Automatic_Updater();
    $enabled = !$updater->is_disabled();
    switch ($type) {
        case 'plugin':
            /**
             * Filters whether plugins auto-update is enabled.
             *
             * @since 5.5.0
             *
             * @param bool $enabled True if plugins auto-update is enabled, false otherwise.
             */
            return apply_filters('plugins_auto_update_enabled', $enabled);
        case 'theme':
            /**
             * Filters whether themes auto-update is enabled.
             *
             * @since 5.5.0
             *
             * @param bool $enabled True if themes auto-update is enabled, false otherwise.
             */
            return apply_filters('themes_auto_update_enabled', $enabled);
    }
    return false;
}

WordPress Version: 5.5

/**
 * Checks whether auto-updates are enabled.
 *
 * @since 5.5.0
 *
 * @param string $type The type of update being checked: 'theme' or 'plugin'.
 * @return bool True if auto-updates are enabled for `$type`, false otherwise.
 */
function wp_is_auto_update_enabled_for_type($type)
{
    if (!class_exists('WP_Automatic_Updater')) {
        require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
    }
    $updater = new WP_Automatic_Updater();
    $enabled = !$updater->is_disabled();
    switch ($type) {
        case 'plugin':
            /**
             * Filters whether plugins auto-update is enabled.
             *
             * @since 5.5.0
             *
             * @param bool $enabled True if plugins auto-update is enabled, false otherwise.
             */
            return apply_filters('plugins_auto_update_enabled', $enabled);
        case 'theme':
            /**
             * Filters whether themes auto-update is enabled.
             *
             * @since 5.5.0
             *
             * @param bool $enabled True if themes auto-update is enabled, false otherwise.
             */
            return apply_filters('themes_auto_update_enabled', $enabled);
    }
    return false;
}