-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuniversal-importer.php
35 lines (31 loc) · 1.08 KB
/
universal-importer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* Plugin Name: Universal Importer (proof of concept)
* Plugin URI: https://github.com/tellyworth/universal-importer
* Description: Proof of Concept plugin for importing content from any source
* Author: WordPress.org
* Version: 0.0.1
* Text Domain: universal-importer
* License: GPLv2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
add_action( 'admin_init', function() {
// autoload
require_once __DIR__ . '/vendor/autoload.php';
// Load the plugin
require_once __DIR__ . '/inc/class-wp-universal-importer.php';
$plugin = new WP_Universal_Importer();
} );
add_action( 'rest_api_init', function () {
require_once __DIR__ . '/inc/class-html-converter-api.php';
} );
function universal_importer_activate() {
// FIXME: needed for wp-now/playground
global $wp_rewrite;
update_option("rewrite_rules", FALSE);
$wp_rewrite->set_permalink_structure('/%postname%/');
$wp_rewrite->flush_rules(true);
// Clear the permalinks after the post type has been registered.
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'universal_importer_activate' );