-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpost-collection.php
More file actions
66 lines (56 loc) · 2.47 KB
/
Copy pathpost-collection.php
File metadata and controls
66 lines (56 loc) · 2.47 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Plugin Name: Post Collection
* Plugin URI: https://github.com/akirk/post-collection
* Description: Save articles from around the web, extract readable content, organize them into collections, and review them with notes in WordPress.
* Version: 2.0.0
* Requires at least: 6.0
* Tested up to: 7.1
* Requires PHP: 7.4
* Author: Alex Kirk
* Author URI: https://alex.kirk.at/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: post-collection
* Domain Path: /languages
*
* @package Post_Collection
*/
namespace PostCollection;
/**
* This file contains the main plugin functionality.
*/
defined( 'ABSPATH' ) || exit;
define( 'POST_COLLECTION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'POST_COLLECTION_PLUGIN_FILE', plugin_dir_path( __FILE__ ) . '/' . basename( __FILE__ ) );
define( 'POST_COLLECTION_VERSION', '2.0.0' );
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/class-user.php';
require_once __DIR__ . '/class-user-query.php';
require_once __DIR__ . '/class-post-collection.php';
require_once __DIR__ . '/class-post-collection-abilities.php';
require_once __DIR__ . '/class-post-collection-app.php';
require_once __DIR__ . '/class-extracted-page.php';
require_once __DIR__ . '/site-configs/class-site-config.php';
require_once __DIR__ . '/site-configs/class-jina.php';
require_once __DIR__ . '/site-configs/class-cloudflare-protected.php';
require_once __DIR__ . '/site-configs/class-youtube.php';
require_once __DIR__ . '/site-configs/class-archive-is.php';
require_once __DIR__ . '/includes/class-article-notes.php';
add_filter( 'post_collection_active', '__return_true' );
function load_post_collection( $friends = null ) {
if ( doing_action( 'init' ) && did_action( 'friends_loaded' ) ) {
return;
}
if ( ! $friends instanceof \Friends\Friends ) {
$friends = null;
}
$post_collection = new Post_Collection( $friends );
$post_collection->register_site_config( new SiteConfig\Archive_Is() );
$post_collection->register_site_config( new SiteConfig\Youtube() );
}
add_action( 'friends_loaded', __NAMESPACE__ . '\load_post_collection' );
add_action( 'init', __NAMESPACE__ . '\load_post_collection' );
register_activation_hook( __FILE__, array( __NAMESPACE__ . '\Post_Collection', 'activate_plugin' ) );
add_action( 'activate_blog', array( __NAMESPACE__ . '\Post_Collection', 'activate_plugin' ) );
add_action( 'wp_initialize_site', array( __NAMESPACE__ . '\Post_Collection', 'activate_for_blog' ) );