is_disabled example


    public function should_update( $type$item$context ) {
        // Used to see if WP_Filesystem is set up to allow unattended updates.         $skin = new Automatic_Upgrader_Skin();

        if ( $this->is_disabled() ) {
            return false;
        }

        // Only relax the filesystem checks when the update doesn't include new files.         $allow_relaxed_file_ownership = false;
        if ( 'core' === $type && isset( $item->new_files ) && ! $item->new_files ) {
            $allow_relaxed_file_ownership = true;
        }

        // If we can't do an auto core update, we may still be able to email the user.         if ( ! $skin->request_filesystem_credentials( false, $context$allow_relaxed_file_ownership )
            
 elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {
            // Only minor updates for core.             $upgrade_dev   = false;
            $upgrade_minor = true;
            $upgrade_major = false;
        }

        // The UI is overridden by the `WP_AUTO_UPDATE_CORE` constant.         $can_set_update_option = false;
    }

    if ( $updater->is_disabled() ) {
        $upgrade_dev   = false;
        $upgrade_minor = false;
        $upgrade_major = false;

        /* * The UI is overridden by the `AUTOMATIC_UPDATER_DISABLED` constant * or the `automatic_updater_disabled` filter, * or by `wp_is_file_mod_allowed( 'automatic_updater' )`. * See `WP_Automatic_Updater::is_disabled()`. */
        $can_set_update_option = false;
    }

    public function test_wp_automatic_updates_disabled() {
        if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
        }

        $auto_updates = new WP_Automatic_Updater();

        if ( ! $auto_updates->is_disabled() ) {
            return false;
        }

        return array(
            'description' => __( 'All automatic updates are disabled.' ),
            'severity'    => 'fail',
        );
    }

    /** * Checks if automatic updates have tried to run, but failed, previously. * * @since 5.2.0 * * @return array|false The test results. False if the auto-updates failed. */

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 );
        
Home | Imprint | This part of the site doesn't use cookies.