forked from publishpress/PublishPress-Authors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
includes.php
84 lines (71 loc) · 3.26 KB
/
includes.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
<?php
/**
* File responsible for defining basic general constants used by the plugin.
*
* @package MultipleAuthors
* @author PublishPress <[email protected]>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
use PPVersionNotices\Module\MenuLink\Module;
defined('ABSPATH') or die('No direct script access allowed.');
if (!defined('PP_AUTHORS_LOADED')) {
require_once __DIR__ . '/defines.php';
if (!class_exists(PP_AUTHORS_AUTOLOAD_CLASS_NAME) && !class_exists('MultipleAuthors\\Plugin')) {
$autoloadPath = PP_AUTHORS_VENDOR_PATH . 'autoload.php';
if (file_exists($autoloadPath)) {
require_once $autoloadPath;
}
}
if (PUBLISHPRESS_AUTHORS_LOAD_DEPRECATED_LEGACY_CODE) {
require_once PP_AUTHORS_BASE_PATH . 'deprecated.php';
}
require_once PP_AUTHORS_BASE_PATH . 'src/functions/template-tags.php';
require_once PP_AUTHORS_BASE_PATH . 'src/functions/amp.php';
if (is_admin() && !defined('PUBLISHPRESS_AUTHORS_SKIP_VERSION_NOTICES')) {
if (!defined('PP_VERSION_NOTICES_LOADED')) {
$includesPath = PP_AUTHORS_VENDOR_PATH . 'publishpress/wordpress-version-notices/includes.php';
if (file_exists($includesPath)) {
require_once $includesPath;
}
}
add_action(
'plugins_loaded',
function () {
if (current_user_can('install_plugins')) {
add_filter(
\PPVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'message' => 'You\'re using PublishPress Authors Free. The Pro version has more features and support. %sUpgrade to Pro%s',
'link' => 'https://publishpress.com/links/authors-banner',
'screens' => [
['base' => 'edit-tags', 'id' => 'edit-author', 'taxonomy' => 'author'],
['base' => 'term', 'id' => 'edit-author', 'taxonomy' => 'author'],
[
'base' => 'authors_page_ppma-modules-settings',
'id' => 'authors_page_ppma-modules-settings'
],
]
];
return $settings;
}
);
add_filter(
Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'parent' => 'ppma-authors',
'label' => 'Upgrade to Pro',
'link' => 'https://publishpress.com/links/authors-menu',
];
return $settings;
}
);
}
}
);
}
require_once PP_AUTHORS_MODULES_PATH . 'multiple-authors/multiple-authors.php';
}