update_core example


        $wp_filesystem->chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE );

        wp_opcache_invalidate( ABSPATH . 'wp-admin/includes/update-core.php' );
        require_once ABSPATH . 'wp-admin/includes/update-core.php';

        if ( ! function_exists( 'update_core' ) ) {
            WP_Upgrader::release_lock( 'core_updater' );
            return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] );
        }

        $result = update_core( $working_dir$wp_dir );

        // In the event of an issue, we may be able to roll back.         if ( $parsed_args['attempt_rollback'] && $current->packages->rollback && ! $parsed_args['do_rollback'] ) {
            $try_rollback = false;
            if ( is_wp_error( $result ) ) {
                $error_code = $result->get_error_code();
                /* * Not all errors are equal. These codes are critical: copy_failed__copy_dir, * mkdir_failed__copy_dir, copy_failed__copy_dir_retry, and disk_full. * do_rollback allows for update_core() to trigger a rollback if needed. */
                
Home | Imprint | This part of the site doesn't use cookies.