BBP_Admin::register_importers()
Register the importers
Description Description
Source Source
File: includes/admin/classes/class-bbp-admin.php
public function register_importers() {
// Leave if we're not in the import section
if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
return;
}
// Load Importer API
require_once ABSPATH . 'wp-admin/includes/import.php';
// Load our importers
$importers = apply_filters( 'bbp_importers', array( 'bbpress' ) );
// Loop through included importers
foreach ( $importers as $importer ) {
// Allow custom importer directory
$import_dir = apply_filters( 'bbp_importer_path', $this->admin_dir . 'importers', $importer );
// Compile the importer path
$import_file = trailingslashit( $import_dir ) . $importer . '.php';
// If the file exists, include it
if ( file_exists( $import_file ) ) {
require $import_file;
}
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |