| 1 |
<?php |
| 2 |
/** |
| 3 |
* Importers file. |
| 4 |
* |
| 5 |
* @package Activitypub |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Activitypub\WP_Admin\Import; |
| 9 |
|
| 10 |
/** |
| 11 |
* Load importers. |
| 12 |
*/ |
| 13 |
function load() { |
| 14 |
require_once ABSPATH . 'wp-admin/includes/import.php'; |
| 15 |
|
| 16 |
if ( ! \class_exists( 'WP_Importer' ) ) { |
| 17 |
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; |
| 18 |
if ( \file_exists( $class_wp_importer ) ) { |
| 19 |
require_once $class_wp_importer; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
\register_importer( |
| 24 |
'mastodon', |
| 25 |
\__( 'Mastodon (Beta)', 'activitypub' ), |
| 26 |
\__( 'Import content from Mastodon.', 'activitypub' ), |
| 27 |
array( __NAMESPACE__ . '\Mastodon', 'dispatch' ) |
| 28 |
); |
| 29 |
|
| 30 |
\register_importer( |
| 31 |
'blocklist', |
| 32 |
\__( 'Domain Blocklist', 'activitypub' ), |
| 33 |
\__( 'Import a domain blocklist in CSV format (Mastodon, IFTAS DNI, etc.)', 'activitypub' ), |
| 34 |
array( __NAMESPACE__ . '\Blocklist', 'dispatch' ) |
| 35 |
); |
| 36 |
|
| 37 |
if ( '1' === \get_option( 'activitypub_following_ui', '0' ) ) { |
| 38 |
\register_importer( |
| 39 |
'starter-kit', |
| 40 |
\__( 'Fediverse Starter Kits (Beta)', 'activitypub' ), |
| 41 |
\__( 'Automatically follow a collection of Fediverse users.', 'activitypub' ), |
| 42 |
array( __NAMESPACE__ . '\Starter_Kit', 'dispatch' ) |
| 43 |
); |
| 44 |
} |
| 45 |
} |
| 46 |
|