forked from publishpress/PublishPress-Authors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublishpress-authors.php
96 lines (82 loc) · 3.45 KB
/
publishpress-authors.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* Plugin Name: PublishPress Authors
* Plugin URI: https://wordpress.org/plugins/publishpress-authors/
* Description: PublishPress Authors allows you to add multiple authors and guest authors to WordPress posts
* Author: PublishPress
* Author URI: https://publishpress.com
* Version: 3.18.0
* Text Domain: publishpress-authors
*
* ------------------------------------------------------------------------------
* Based on Co-Authors Plus.
* Authors: Mohammad Jangda, Daniel Bachhuber, Automattic
* Copyright: 2008-2015 Shared and distributed between Mohammad Jangda, Daniel Bachhuber, Weston Ruter
* ------------------------------------------------------------------------------
*
* GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @link https://publishpress.com/authors/
* @package MultipleAuthors
* @author PublishPress <[email protected]>
* @copyright Copyright (C) 2020 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
use MultipleAuthors\Factory;
use MultipleAuthors\Plugin;
$includeFilebRelativePath = '/publishpress/publishpress-instance-protection/include.php';
if (file_exists(__DIR__ . '/vendor' . $includeFilebRelativePath)) {
require_once __DIR__ . '/vendor' . $includeFilebRelativePath;
} else if (defined('PP_AUTHORS_VENDOR_PATH') && file_exists(PP_AUTHORS_VENDOR_PATH . $includeFilebRelativePath)) {
require_once PP_AUTHORS_VENDOR_PATH . $includeFilebRelativePath;
}
if (class_exists('PublishPressInstanceProtection\\Config')) {
$pluginCheckerConfig = new PublishPressInstanceProtection\Config();
$pluginCheckerConfig->pluginSlug = 'publishpress-authors';
$pluginCheckerConfig->pluginName = 'PublishPress Authors';
$pluginChecker = new PublishPressInstanceProtection\InstanceChecker($pluginCheckerConfig);
}
if (defined('PP_AUTHORS_PRO_LOADED')) {
add_filter(
'plugin_row_meta',
function ($links, $file) {
if ($file == plugin_basename(__FILE__)) {
$links[]= '<strong>' . esc_html__('This plugin can be deleted.', 'publishpress-authors') . '</strong>';
}
return $links;
},
10,
2
);
}
if (! defined('PP_AUTHORS_LOADED')) {
require_once __DIR__ . '/includes.php';
global $multiple_authors_addon;
if (defined('WP_CLI') && WP_CLI) {
WP_CLI::add_command('publishpress-authors', 'MultipleAuthors\\WP_Cli');
}
// Init the legacy plugin instance
$legacyPlugin = Factory::getLegacyPlugin();
$multiple_authors_addon = new Plugin();
register_activation_hook(
PP_AUTHORS_FILE,
function () {
require_once PP_AUTHORS_BASE_PATH . 'activation.php';
}
);
include_once __DIR__ . '/src/functions/notify.php';
}