-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtwitter-archive-to-wp.php
42 lines (34 loc) · 1.09 KB
/
twitter-archive-to-wp.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
36
37
38
39
40
41
42
<?php
/**
* Plugin Name: Import Twitter Data Archive
* Plugin URI: https://github.com/shawnhooper/twitter-archive-to-wp
* Description: Imports Twitter Archive as a custom post type
* Author: Shawn M. Hooper
* Author URI: https://shawnhooper.ca/
* Text Domain: birdsite-archive
* Domain Path: /languages
* Version: 2.0.3
*
* @package Birdsite_Archive
*/
namespace ShawnHooper\BirdSiteArchive;
use WP_CLI;
class BirdSiteArchive {
private ?bool $has_tweets = null;
/**
* Hook this plugin into WordPress' actions & filters
*/
public function hooks() : void {
if ( defined( 'WP_CLI' ) && WP_CLI ) {
include_once('classes/import-twitter-command.php');
$cli_command = new Import_Twitter_Command();
WP_CLI::add_command( 'import-twitter', $cli_command );
}
/** Register hooks for the Tweet Post Type */
include_once('classes/tweet-post-type.php');
$tweet_post_type = new Tweet_Post_Type();
$tweet_post_type->wordpress_hooks();
}
}
$_GLOBALS['BirdSiteArchive'] = new BirdSiteArchive();
$_GLOBALS['BirdSiteArchive']->hooks();