PHP Class WC_Tax_Rate_Importer

Author: WooThemes
Inheritance: extends WP_Importer
Show file Open project: woocommerce/woocommerce Class Usage Examples

Public Properties

Property Type Description
$delimiter string The current delimiter.
$file_url string The current file url.
$id integer The current file id.
$import_page string The current import page.

Public Methods

Method Description
__construct ( ) Constructor.
bump_request_timeout ( integer $val ) : integer Added to http_request_timeout filter to force timeout at 60 seconds during import.
dispatch ( ) Registered callback function for the WordPress Importer.
footer ( ) Output footer html.
format_data_from_csv ( mixed $data, string $enc ) : string UTF-8 encode the data if $enc value isn't UTF-8.
greet ( ) Output information about the uploading process.
handle_upload ( ) : boolean Handles the CSV upload and initial parsing of the file to prepare for.
header ( ) Output header html.
import ( mixed $file ) Import the file if it exists and is valid.
import_end ( ) Performs post-import cleanup of files and the cache.

Private Methods

Method Description
import_error ( string $message = '' ) Show import error and quit.
import_start ( ) Import is starting.

Method Details

__construct() public method

Constructor.
public __construct ( )

bump_request_timeout() public method

Added to http_request_timeout filter to force timeout at 60 seconds during import.
public bump_request_timeout ( integer $val ) : integer
$val integer
return integer 60

dispatch() public method

Manages the three separate stages of the CSV import process.
public dispatch ( )

format_data_from_csv() public method

UTF-8 encode the data if $enc value isn't UTF-8.
public format_data_from_csv ( mixed $data, string $enc ) : string
$data mixed
$enc string
return string

greet() public method

Output information about the uploading process.
public greet ( )

handle_upload() public method

displaying author import options.
public handle_upload ( ) : boolean
return boolean False if error uploading or invalid file, true otherwise

header() public method

Output header html.
public header ( )

import() public method

Import the file if it exists and is valid.
public import ( mixed $file )
$file mixed

import_end() public method

Performs post-import cleanup of files and the cache.
public import_end ( )

Property Details

$delimiter public property

The current delimiter.
public string $delimiter
return string

$file_url public property

The current file url.
public string $file_url
return string

$id public property

The current file id.
public int $id
return integer

$import_page public property

The current import page.
public string $import_page
return string