Action
rpress_batch_import_class_include
On this page
Fires before a batch importer class is instantiated during an import request.
Runs in the AJAX handlers for the file upload step and for each import processing step, just before the class named in the request is instantiated. Use it to require the file that defines the importer class.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$import_class | string | The importer class name submitted with the request. |
Example#
function my_include_importer( $import_class ) {
if ( 'My_Batch_Importer' === $import_class ) {
require_once plugin_dir_path( __FILE__ ) . 'class-my-batch-importer.php';
}
}
add_action( 'rpress_batch_import_class_include', 'my_include_importer', 10, 1 );
Notes#
Fired from two places: rpress_do_ajax_import_file_upload() (class from rpress-import-class) and rpress_do_ajax_import() (class from class). The class name comes from the request, so validate it before including files.
Source#
Fired from:
includes/admin/import/import-functions.php(line 58), inrpress_do_ajax_import_file_upload()includes/admin/import/import-functions.php(line 103), inrpress_do_ajax_import()
See also#
Was this page helpful?
