-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathincludes.php
76 lines (65 loc) · 3.52 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
<?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 (file_exists(PP_AUTHORS_LIB_VENDOR_PATH . '/cmb2/cmb2/init.php')) {
require_once PP_AUTHORS_LIB_VENDOR_PATH . '/cmb2/cmb2/init.php';
}
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')) {
add_action(
'plublishpress_authors_loaded',
function () {
if (current_user_can('install_plugins')) {
add_filter(
\PPVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'message' => esc_html__("You're using PublishPress Authors Free. The Pro version has more features and support. %sUpgrade to Pro%s", 'publishpress-authors'),
'link' => 'https://publishpress.com/links/authors-banner',
'screens' => [
['base' => 'edit-tags', 'id' => 'edit-author', 'taxonomy' => 'author'],
['base' => 'term', 'id' => 'edit-author', 'taxonomy' => 'author'],
['base' => 'edit', 'id' => 'edit-ppma_boxes', 'post_type' => 'ppma_boxes'],
['base' => 'post', 'id' => 'ppma_boxes', 'post_type' => 'ppma_boxes'],
['base' => 'edit', 'id' => 'edit-ppmacf_field', 'post_type' => 'ppmacf_field'],
['base' => 'post', 'id' => 'ppmacf_field', 'post_type' => 'ppmacf_field'],
['base' => 'authors_page_ppma-modules-settings', 'id' => 'authors_page_ppma-modules-settings'],
['base' => 'authors_page_ppma-author-list', 'id' => 'authors_page_ppma-author-list'],
['base' => 'authors_page_ppma-author-pages', 'id' => 'authors_page_ppma-author-pages'],
]
];
return $settings;
}
);
add_filter(
Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-authors'] = [
'parent' => 'ppma-authors',
'label' => __( 'Upgrade to Pro', 'publishpress-authors' ),
'link' => 'https://publishpress.com/links/authors-menu',
];
return $settings;
}
);
}
}
);
}
require_once PP_AUTHORS_MODULES_PATH . 'multiple-authors/multiple-authors.php';
}