public function saveFiles($ids)
    {
        // Work on $_FILES
        $files = $_FILES;

        if (empty($files) || empty($ids)) {
            return;
        }

        // Get required files
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'image.php';
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'file.php';
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'media.php';

        // Iterate
        foreach ($files as $k => $v) {
            // Don't do nothing if no file is defined
            if (empty($v['tmp_name']) || !in_array($k, $ids)) {
                continue;
            }

            // Do the magic
            $file = wp_handle_upload($v, ['test_form' => false]);

            // Register settings
            Option::set($k, $file['url']);
        }
    }
public function saveFiles($ids)
    {
        // Work on $_FILES
        $files = $_FILES;

        if (empty($files) || empty($ids)) {
            return;
        }

        // Get required files
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'image.php';
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'file.php';
        require_once ABSPATH.'wp-admin'.S.'includes'.S.'media.php';

        // Iterate
        foreach ($files as $k => $v) {
            // Don't do nothing if no file is defined
            if (empty($v['tmp_name']) || !in_array($k, $ids)) {
                continue;
            }

            // Do the magic
            $file = wp_handle_upload($v, ['test_form' => false]);

            // Register settings
            Option::set($k, $file['url']);
        }
    }
public function saveFiles ( $ ids ) { // Work on $_FILES $ files = $ _FILES ; if ( empty ( $ files ) || empty ( $ ids ) ) { return ; } // Get required files require_once ABSPATH . 'wp-admin' . S . 'includes' . S . 'image.php' ; require_once ABSPATH . 'wp-admin' . S . 'includes' . S . 'file.php' ; require_once ABSPATH . 'wp-admin' . S . 'includes' . S . 'media.php' ; // Iterate foreach ( $ files as $ k => $ v ) { // Don't do nothing if no file is defined if ( empty ( $ v [ 'tmp_name' ] ) || ! in_array ( $ k , $ ids ) ) { continue ; } // Do the magic $ file = wp_handle_upload ( $ v , [ 'test_form' => false ] ) ; // Register settings Option :: set ( $ k , $ file [ 'url' ] ) ; } }
Save files.

@param array $ids
Save files .