Microweber\Utils\Import::queue_import_json PHP Method

queue_import_json() public method

public queue_import_json ( $filename )
    public function queue_import_json($filename)
    {
        only_admin_access();
        if (!is_file($filename)) {
            return array('error' => 'You have not provided a existing backup to restore.');
        }
        $json = file_get_contents($filename);
        $rows = json_decode($json, true);
        $content_items = $rows;
        $content_items = $this->map_array($rows);
        return $this->batch_save($content_items);
    }