forked from publishpress/PublishPress-Authors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCapability.php
46 lines (37 loc) · 1.23 KB
/
Capability.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
<?php
/**
* @package MultipleAuthors\
* @author PublishPress <[email protected]>
* @copyright Copyright (C) 2018 PublishPress. All rights reserved.
* @license GPLv2 or later
* @since 1.0.0
*/
namespace MultipleAuthors;
defined('ABSPATH') or die('No direct script access allowed.');
abstract class Capability
{
public static function getManageAuthorsCapability()
{
return apply_filters('pp_multiple_authors_manage_authors_cap', 'ppma_manage_authors');
}
public static function getManageOptionsCapability()
{
return apply_filters('pp_multiple_authors_manage_settings_cap', 'manage_options');
}
public static function getEditPostAuthorsCapability()
{
return apply_filters('pp_multiple_authors_edit_post_authors', 'ppma_edit_post_authors');
}
public static function currentUserCanManageSettings()
{
return current_user_can(self::getManageOptionsCapability());
}
public static function currentUserCanManageAuthors()
{
return current_user_can(self::getManageAuthorsCapability());
}
public static function currentUserCanEditPostAuthors()
{
return current_user_can(self::getEditPostAuthorsCapability());
}
}