Action
rpress_batch_export_class_include
On this page
Fires when a batch export or tool class is requested so it can load its class file.
Called with the name of the requested batch class just before the class is validated and instantiated. Built-in exporters and tools hook here and require_once their class file when the name matches theirs. Third-party batch exporters that extend RPRESS_Batch_Export should do the same, since the class must exist before RestroPress will run it.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$class | string | Class name of the requested batch export or tool. |
Example#
function my_include_batch_export( $class ) {
if ( 'My_Batch_Orders_Export' === $class ) {
require_once plugin_dir_path( __FILE__ ) . 'class-my-batch-orders-export.php';
}
}
add_action( 'rpress_batch_export_class_include', 'my_include_batch_export', 10, 1 );
Notes#
Fired from the batch export request handler, from the AJAX export step in the admin assets class, and from the AJAX export function. The argument comes from the submitted form, so compare it against a known class name and do not include files based on it directly. After this action the class must exist, extend RPRESS_Batch_Export, and the user must pass the rpress_export_capability check.
Source#
Fired from:
includes/admin/class-rp-admin-assets.php(line 2097), inRP_Admin_Assets::rpress_do_ajax_export()includes/admin/reporting/export/export-actions.php(line 25), inrpress_process_batch_export_fooditem()includes/admin/reporting/export/export-functions.php(line 54), inrpress_do_ajax_export()
