Version Description
- 9 Jan 2020 =
- Change : Renamed to PublishPress Capabilities
- Feature : Capabilities link on PublishPress > Roles row opens Role Capabilities screen
- Feature : Role Capabilities screen links to PublishPress > Roles for member management
- Fixed : Browser reload caused Role Capabilities screen to display default role
- Fixed : Add Capability sidebar added custom capability to role immediately, but capability checkbox did not display as checked until reload
- Fixed : Category Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
- Fixed : Term Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
- Fixed : Multisite - On sub-sites, Role Capabilities screen did not display PublishPress Capabilities section to Super Administrators who don't have a role on the site
- Fixed : Role name captions on Role Capabilities and Backup Tool screens could not be translated
- Fixed : Checkbox bulk selection on Role Capabilities screen was incorrect under some conditions
- Change : Reinstate WordPress edit_published_posts workaround with correct status filtering behavior
- Change : Apply workaround filters for WordPress edit_published_posts / publish_posts handling only for users who have edit_published_posts capability for current post type
Download this release
Release Info
Developer | kevinB |
Plugin | Capability Manager Enhanced |
Version | 1.9 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.9
- admin.css +13 -2
- admin.dev.js +2 -2
- admin.js +1 -1
- capsman-enhanced.php +93 -141
- includes/admin.php +100 -97
- includes/backup.php +28 -20
- includes/filters-wp_rest_workarounds.php +157 -36
- includes/filters.php +99 -0
- includes/functions-admin.php +30 -0
- includes/functions.php +78 -0
- includes/handler.php +16 -8
- includes/manager.php +102 -39
- includes/network.php +5 -4
- includes/pp-handler.php +7 -2
- includes/pp-ui.php +7 -7
- includes/publishpress-roles.php +36 -0
- lang/capsman.mo +0 -0
- lang/capsman.po +229 -261
- readme.txt +24 -10
admin.css
CHANGED
@@ -189,13 +189,17 @@ margin-top:5px;
|
|
189 |
}
|
190 |
|
191 |
td.cm-has-via-pp {
|
192 |
-
background-color: #
|
193 |
}
|
194 |
|
195 |
div.pressshack-admin-wrapper footer {
|
196 |
padding-right: 270px;
|
197 |
}
|
198 |
|
|
|
|
|
|
|
|
|
199 |
#akmin div.publishpress-headline {line-height:25px}
|
200 |
#akmin span.publishpress-thanks{margin-left:5px;color:#655997;white-space:nowrap}
|
201 |
#akmin span.publishpress-thanks,#akmin span.publishpress-thanks a,#akmin span.publishpress-thanks a:visited {color:#655997;font-weight:bold;}
|
@@ -209,4 +213,11 @@ table#akmin td.sidebar li.publishpress-contact a{padding:5px 0 5px 0;}
|
|
209 |
#pp_features ul.pp-features { list-style: none; padding-top:10px; text-align:left; margin-left: auto }
|
210 |
#pp_features ul.pp-features li:before { content: "\2713\0020"; }
|
211 |
#pp_features ul.pp-features li { padding-bottom: 5px }
|
212 |
-
#pp_features img.cme-play { margin-bottom: -3px; margin-left: 5px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
|
191 |
td.cm-has-via-pp {
|
192 |
+
background-color: #84fb84;
|
193 |
}
|
194 |
|
195 |
div.pressshack-admin-wrapper footer {
|
196 |
padding-right: 270px;
|
197 |
}
|
198 |
|
199 |
+
body.capabilities_page_capsman-tool div.pressshack-admin-wrapper footer {
|
200 |
+
padding-right: 5px;
|
201 |
+
}
|
202 |
+
|
203 |
#akmin div.publishpress-headline {line-height:25px}
|
204 |
#akmin span.publishpress-thanks{margin-left:5px;color:#655997;white-space:nowrap}
|
205 |
#akmin span.publishpress-thanks,#akmin span.publishpress-thanks a,#akmin span.publishpress-thanks a:visited {color:#655997;font-weight:bold;}
|
213 |
#pp_features ul.pp-features { list-style: none; padding-top:10px; text-align:left; margin-left: auto }
|
214 |
#pp_features ul.pp-features li:before { content: "\2713\0020"; }
|
215 |
#pp_features ul.pp-features li { padding-bottom: 5px }
|
216 |
+
#pp_features img.cme-play { margin-bottom: -3px; margin-left: 5px;}
|
217 |
+
|
218 |
+
div.publishpress-caps-manage span.manage-members {margin-left:5px; font-weight:normal; color: #777}
|
219 |
+
div.publishpress-caps-manage span.manage-members a {color: #777}
|
220 |
+
div.publishpress-caps-manage span.manage-members a:hover {text-decoration: underline; color:#655997 }
|
221 |
+
|
222 |
+
div.publishpress-headline .cme-subtext a {font-weight: bold}
|
223 |
+
div.publishpress-headline .cme-subtext a:hover {text-decoration: underline}
|
admin.dev.js
CHANGED
@@ -39,10 +39,10 @@ jQuery(document).ready( function($) {
|
|
39 |
});
|
40 |
|
41 |
$('table.cme-typecaps a.neg-type-caps').click( function(e) {
|
42 |
-
$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each( function(
|
43 |
$(this).addClass('cap-neg');
|
44 |
|
45 |
-
var cap_name_attr = $(this).
|
46 |
$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
|
47 |
});
|
48 |
|
39 |
});
|
40 |
|
41 |
$('table.cme-typecaps a.neg-type-caps').click( function(e) {
|
42 |
+
$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each( function() {
|
43 |
$(this).addClass('cap-neg');
|
44 |
|
45 |
+
var cap_name_attr = $(this).find('input[type="checkbox"]').attr('name');
|
46 |
$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
|
47 |
});
|
48 |
|
admin.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
jQuery(document).ready(function($){$('a.neg-cap').attr('title',cmeAdmin.negationCaption);$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);$('span.cap-x').attr('title',cmeAdmin.capNegated);$('table.cme-checklist input[class!="cme-check-all"]').not(':disabled').attr('title',cmeAdmin.chkCaption);$('table.cme-checklist a.neg-cap').click(function(e){$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');return false;});$(document).on('click','table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span',function(e){$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$(this).parent().find('input[type="checkbox"]').prop('checked',false);$(this).parent().find('input.cme-negation-input').remove();return false;});$('input.cme-check-all').click(function(e){$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked',$(this).is(":checked"));});$('a.cme-neg-all').click(function(e){$(this).closest('table').find('a.neg-cap:visible').click();return false;});$('a.cme-switch-all').click(function(e){$(this).closest('table').find('td.cap-neg span').click();return false;});$('table.cme-typecaps a.neg-type-caps').click(function(e){$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each(function(
|
2 |
var class_sel='[class*="term-cap"]';else
|
3 |
var class_sel='[class*="post-cap"]';$(this).closest("table").find("tr td"+class_sel+":nth-child("+(columnNo+1)+') input[type="checkbox"]:visible').prop("checked",check_val);$(this).prop('checked_all',check_val);});$('a.cme-fix-read-cap').click(function(){$('input[name="caps[read]"]').prop('checked',true);$('input[name="SaveRole"]').trigger('click');return false;});});
|
1 |
+
jQuery(document).ready(function($){$('a.neg-cap').attr('title',cmeAdmin.negationCaption);$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);$('span.cap-x').attr('title',cmeAdmin.capNegated);$('table.cme-checklist input[class!="cme-check-all"]').not(':disabled').attr('title',cmeAdmin.chkCaption);$('table.cme-checklist a.neg-cap').click(function(e){$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');return false;});$(document).on('click','table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span',function(e){$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$(this).parent().find('input[type="checkbox"]').prop('checked',false);$(this).parent().find('input.cme-negation-input').remove();return false;});$('input.cme-check-all').click(function(e){$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked',$(this).is(":checked"));});$('a.cme-neg-all').click(function(e){$(this).closest('table').find('a.neg-cap:visible').click();return false;});$('a.cme-switch-all').click(function(e){$(this).closest('table').find('td.cap-neg span').click();return false;});$('table.cme-typecaps a.neg-type-caps').click(function(e){$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each(function(){$(this).addClass('cap-neg');var cap_name_attr=$(this).find('input[type="checkbox"]').attr('name');$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');});return false;});$('table.cme-typecaps th').click(function(){var columnNo=$(this).index();var check_val=!$(this).prop('checked_all');if($(this).hasClass('term-cap'))
|
2 |
var class_sel='[class*="term-cap"]';else
|
3 |
var class_sel='[class*="post-cap"]';$(this).closest("table").find("tr td"+class_sel+":nth-child("+(columnNo+1)+') input[type="checkbox"]:visible').prop("checked",check_val);$(this).prop('checked_all',check_val);});$('a.cme-fix-read-cap').click(function(){$('input[name="caps[read]"]').prop('checked',true);$('input[name="SaveRole"]').trigger('click');return false;});});
|
capsman-enhanced.php
CHANGED
@@ -1,16 +1,18 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name:
|
4 |
-
* Plugin URI: https://publishpress.com
|
5 |
* Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
|
6 |
-
* Version: 1.
|
7 |
* Author: PublishPress
|
8 |
-
* Author URI: https://publishpress.com
|
9 |
* Text Domain: capsman-enhanced
|
10 |
* Domain Path: /lang/
|
|
|
|
|
11 |
* License: GPLv3
|
12 |
*
|
13 |
-
* Copyright (c)
|
14 |
*
|
15 |
* ------------------------------------------------------------------------------
|
16 |
* Based on Capability Manager
|
@@ -20,168 +22,118 @@
|
|
20 |
*
|
21 |
* @package capability-manager-enhanced
|
22 |
* @author PublishPress
|
23 |
-
* @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C)
|
24 |
* @license GNU General Public License version 3
|
25 |
-
* @link https://publishpress.com
|
26 |
-
* @version 1.
|
27 |
*/
|
28 |
|
29 |
-
if (
|
30 |
-
define(
|
31 |
-
define(
|
|
|
32 |
}
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
} else {
|
42 |
-
define ( 'CME_FILE', __FILE__ );
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Sets an admin warning regarding required PHP version.
|
46 |
-
*
|
47 |
-
* @hook action 'admin_notices'
|
48 |
-
* @return void
|
49 |
-
*/
|
50 |
-
function _cman_php_warning() {
|
51 |
-
$data = get_plugin_data(__FILE__);
|
52 |
-
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
|
53 |
-
|
54 |
-
echo '<div class="error"><p><strong>' . __('Warning:', 'capsman-enhanced') . '</strong> '
|
55 |
-
. sprintf(__('The active plugin %s is not compatible with your PHP version.', 'capsman-enhanced') .'</p><p>',
|
56 |
-
'«' . $data['Name'] . ' ' . $data['Version'] . '»')
|
57 |
-
. sprintf(__('%s is required for this plugin.', 'capsman-enhanced'), 'PHP-5 ')
|
58 |
-
. '</p></div>';
|
59 |
-
}
|
60 |
-
|
61 |
-
// ============================================ START PROCEDURE ==========
|
62 |
-
|
63 |
-
// Check required PHP version.
|
64 |
-
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
|
65 |
-
// Send an armin warning
|
66 |
-
add_action('admin_notices', '_cman_php_warning');
|
67 |
-
} else {
|
68 |
-
global $pagenow;
|
69 |
-
|
70 |
-
if ( is_admin() &&
|
71 |
-
( isset($_REQUEST['page']) && in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) )
|
72 |
-
|| ( ! empty($_SERVER['SCRIPT_NAME']) && strpos( $_SERVER['SCRIPT_NAME'], 'p-admin/plugins.php' ) && ! empty($_REQUEST['action'] ) )
|
73 |
-
|| ( isset($_GET['action']) && 'reset-defaults' == $_GET['action'] )
|
74 |
-
|| in_array( $pagenow, array( 'users.php', 'user-edit.php', 'profile.php', 'user-new.php' ) )
|
75 |
-
) ) {
|
76 |
-
global $capsman;
|
77 |
-
|
78 |
-
// Run the plugin
|
79 |
-
require_once ( dirname(__FILE__) . '/framework/lib/formating.php' );
|
80 |
-
require_once ( dirname(__FILE__) . '/framework/lib/users.php' );
|
81 |
-
|
82 |
-
require_once ( dirname(__FILE__) . '/includes/manager.php' );
|
83 |
-
$capsman = new CapabilityManager();
|
84 |
-
} else {
|
85 |
-
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
|
86 |
-
add_action( 'admin_menu', 'cme_submenus', 20 );
|
87 |
-
}
|
88 |
}
|
89 |
}
|
90 |
|
91 |
-
|
92 |
-
add_action( 'plugins_loaded', '_cme_act_pp_active', 1 );
|
93 |
-
|
94 |
-
add_action( 'init', '_cme_cap_helper', 49 ); // Press Permit Cap Helper, registered at 50, will leave caps which we've already defined
|
95 |
-
//add_action( 'wp_loaded', '_cme_cap_helper_late_init', 99 ); // now instead adding registered_post_type, registered_taxonomy action handlers for latecomers
|
96 |
-
// @todo: do this in PP Core also
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
define( 'OLD_PRESSPERMIT_ACTIVE', true );
|
104 |
-
}
|
105 |
-
}
|
106 |
}
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
add_action( 'registered_taxonomy', '_cme_taxonomy_late_reg', 5, 2 );
|
116 |
}
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
if ( ! empty( $tx_obj->public ) ) {
|
130 |
-
$cme_cap_helper->refresh();
|
131 |
-
}
|
132 |
}
|
133 |
|
134 |
-
|
135 |
-
|
136 |
|
137 |
-
|
138 |
-
}
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
|
143 |
-
add_management_page(__('Capability Manager', 'capsman-enhanced'), __('Capability Manager', 'capsman-enhanced'), $cap_name, 'capsman' . '-tool', 'cme_fakefunc');
|
144 |
-
|
145 |
-
if (did_action('pp_admin_menu')) { // Put Capabilities link on Permissions menu if Press Permit is active and user has access to it
|
146 |
-
global $pp_admin;
|
147 |
-
$menu_caption = ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
|
148 |
-
add_submenu_page( $pp_admin->get_menu('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', 'capsman', 'cme_fakefunc' );
|
149 |
-
|
150 |
-
} elseif(did_action('presspermit_admin_menu') && function_exists('presspermit')) {
|
151 |
-
$menu_caption = ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
|
152 |
-
add_submenu_page( presspermit()->admin()->getMenuParams('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', 'capsman', 'cme_fakefunc' );
|
153 |
-
|
154 |
-
} else {
|
155 |
-
add_users_page( __('Capability Manager', 'capsman-enhanced'), __('Capabilities', 'capsman-enhanced'), 'manage_capabilities', 'capsman', 'cme_fakefunc');
|
156 |
-
}
|
157 |
}
|
158 |
|
159 |
-
|
160 |
-
if ( ! $check_plugin_file )
|
161 |
-
return false;
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
}
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
|
177 |
-
$
|
178 |
-
|
|
|
|
|
179 |
}
|
180 |
}
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
185 |
|
186 |
if ( is_multisite() )
|
187 |
-
require_once ( dirname(__FILE__) . '/includes/network.php' );
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: PublishPress Capabilities
|
4 |
+
* Plugin URI: https://publishpress.com/capability-manager/
|
5 |
* Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
|
6 |
+
* Version: 1.9
|
7 |
* Author: PublishPress
|
8 |
+
* Author URI: https://publishpress.com/
|
9 |
* Text Domain: capsman-enhanced
|
10 |
* Domain Path: /lang/
|
11 |
+
* Min WP Version: 4.9.7
|
12 |
+
* Requires PHP: 5.6.20
|
13 |
* License: GPLv3
|
14 |
*
|
15 |
+
* Copyright (c) 2020 PublishPress
|
16 |
*
|
17 |
* ------------------------------------------------------------------------------
|
18 |
* Based on Capability Manager
|
22 |
*
|
23 |
* @package capability-manager-enhanced
|
24 |
* @author PublishPress
|
25 |
+
* @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
|
26 |
* @license GNU General Public License version 3
|
27 |
+
* @link https://publishpress.com/
|
28 |
+
* @version 1.9
|
29 |
*/
|
30 |
|
31 |
+
if (!defined('CAPSMAN_VERSION')) {
|
32 |
+
define('CAPSMAN_VERSION', '1.9');
|
33 |
+
define('CAPSMAN_ENH_VERSION', '1.9');
|
34 |
+
define('PUBLISHPRESS_CAPS_VERSION', '1.9');
|
35 |
}
|
36 |
|
37 |
+
foreach (get_option('active_plugins') as $plugin_file) {
|
38 |
+
if ( false !== strpos($plugin_file, 'capsman.php') ) {
|
39 |
+
add_action('admin_notices', function() {
|
40 |
+
$message = __( '<strong>Error:</strong> PublishPress Capabilities cannot function because another copy of Capability Manager is active.', 'capsman-enhanced' );
|
41 |
+
echo '<div id="message" class="error fade" style="color: black">' . $message . '</div>';
|
42 |
+
});
|
43 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
}
|
46 |
|
47 |
+
$pro_active = false;
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
foreach ((array)get_option('active_plugins') as $plugin_file) {
|
50 |
+
if (false !== strpos($plugin_file, 'capabilities-pro-by-publishpress.php')) {
|
51 |
+
$pro_active = true;
|
52 |
+
break;
|
53 |
+
}
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
+
if (!$pro_active && is_multisite()) {
|
57 |
+
foreach (array_keys((array)get_site_option('active_sitewide_plugins')) as $plugin_file) {
|
58 |
+
if (false !== strpos($plugin_file, 'capabilities-pro-by-publishpress.php')) {
|
59 |
+
$pro_active = true;
|
60 |
+
break;
|
61 |
+
}
|
62 |
+
}
|
|
|
63 |
}
|
64 |
|
65 |
+
if ($pro_active) {
|
66 |
+
add_filter(
|
67 |
+
'plugin_row_meta',
|
68 |
+
function($links, $file)
|
69 |
+
{
|
70 |
+
if ($file == plugin_basename(__FILE__)) {
|
71 |
+
$links[]= __('<strong>This plugin can be deleted.</strong>', 'press-permit-core');
|
72 |
+
}
|
73 |
+
|
74 |
+
return $links;
|
75 |
+
},
|
76 |
+
10, 2
|
77 |
+
);
|
78 |
}
|
79 |
|
80 |
+
if (defined('CME_FILE') || $pro_active) {
|
81 |
+
return;
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
+
define ( 'CME_FILE', __FILE__ );
|
85 |
+
define ('PUBLISHPRESS_CAPS_ABSPATH', __DIR__);
|
86 |
|
87 |
+
require_once (dirname(__FILE__) . '/includes/functions.php');
|
|
|
88 |
|
89 |
+
if (is_admin()) {
|
90 |
+
require_once (dirname(__FILE__) . '/includes/functions-admin.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
+
// ============================================ START PROCEDURE ==========
|
|
|
|
|
94 |
|
95 |
+
// Check required PHP version.
|
96 |
+
if ( version_compare(PHP_VERSION, '5.4.0', '<') ) {
|
97 |
+
// Send an armin warning
|
98 |
+
add_action('admin_notices', function() {
|
99 |
+
$data = get_plugin_data(__FILE__);
|
100 |
+
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
|
|
|
101 |
|
102 |
+
echo '<div class="error"><p><strong>' . __('Warning:', 'capsman-enhanced') . '</strong> '
|
103 |
+
. sprintf(__('The active plugin %s is not compatible with your PHP version.', 'capsman-enhanced') .'</p><p>',
|
104 |
+
'«' . $data['Name'] . ' ' . $data['Version'] . '»')
|
105 |
+
. sprintf(__('%s is required for this plugin.', 'capsman-enhanced'), 'PHP-5 ')
|
106 |
+
. '</p></div>';
|
107 |
+
});
|
108 |
+
} else {
|
109 |
+
global $pagenow;
|
110 |
+
|
111 |
+
if ( is_admin() &&
|
112 |
+
( isset($_REQUEST['page']) && in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) )
|
113 |
+
|| ( ! empty($_SERVER['SCRIPT_NAME']) && strpos( $_SERVER['SCRIPT_NAME'], 'p-admin/plugins.php' ) && ! empty($_REQUEST['action'] ) )
|
114 |
+
|| ( isset($_GET['action']) && 'reset-defaults' == $_GET['action'] )
|
115 |
+
|| in_array( $pagenow, array( 'users.php', 'user-edit.php', 'profile.php', 'user-new.php' ) )
|
116 |
+
) ) {
|
117 |
+
global $capsman;
|
118 |
+
|
119 |
+
// Run the plugin
|
120 |
+
require_once ( dirname(__FILE__) . '/framework/lib/formating.php' );
|
121 |
+
require_once ( dirname(__FILE__) . '/framework/lib/users.php' );
|
122 |
|
123 |
+
require_once ( dirname(__FILE__) . '/includes/manager.php' );
|
124 |
+
$capsman = new CapabilityManager();
|
125 |
+
} else {
|
126 |
+
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
|
127 |
+
add_action( 'admin_menu', 'cme_submenus', 20 );
|
128 |
}
|
129 |
}
|
130 |
|
131 |
+
add_action( 'init', '_cme_init' );
|
132 |
+
add_action( 'plugins_loaded', '_cme_act_pp_active', 1 );
|
133 |
+
|
134 |
+
add_action( 'init', '_cme_cap_helper', 49 ); // Press Permit Cap Helper, registered at 50, will leave caps which we've already defined
|
135 |
+
//add_action( 'wp_loaded', '_cme_cap_helper_late_init', 99 ); // now instead adding registered_post_type, registered_taxonomy action handlers for latecomers
|
136 |
+
// @todo: do this in PP Core also
|
137 |
|
138 |
if ( is_multisite() )
|
139 |
+
require_once ( dirname(__FILE__) . '/includes/network.php' );
|
includes/admin.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* General Admin for
|
4 |
* Provides admin pages to create and manage roles and capabilities.
|
5 |
*
|
6 |
* @author Jordi Canals, Kevin Behrens
|
7 |
-
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C)
|
8 |
* @license GNU General Public License version 2
|
9 |
* @link https://publishpress.com
|
10 |
*
|
11 |
*
|
12 |
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
-
* Modifications Copyright
|
14 |
*
|
15 |
* This program is free software; you can redistribute it and/or
|
16 |
* modify it under the terms of the GNU General Public License
|
@@ -27,6 +27,8 @@
|
|
27 |
|
28 |
global $capsman, $cme_cap_helper, $current_user;
|
29 |
|
|
|
|
|
30 |
$roles = $this->roles;
|
31 |
$default = $this->current;
|
32 |
|
@@ -47,7 +49,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
47 |
$pp_metagroup_caps = array();
|
48 |
}
|
49 |
?>
|
50 |
-
<div class="wrap pressshack-admin-wrapper">
|
51 |
<?php if( defined('PRESSPERMIT_ACTIVE') ) :
|
52 |
pp_icon();
|
53 |
$style = 'style="height:60px;"';
|
@@ -58,16 +60,25 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
58 |
<div id="icon-capsman-admin" class="icon32"></div>
|
59 |
<?php endif; ?>
|
60 |
|
61 |
-
<h1 <?php echo $style;?>><?php _e('
|
62 |
|
63 |
-
<form method="post" action="admin.php?page=<?php echo $this->ID ?>">
|
64 |
<?php wp_nonce_field('capsman-general-manager'); ?>
|
65 |
<fieldset>
|
66 |
<table id="akmin">
|
67 |
<tr>
|
68 |
<td class="content">
|
69 |
<dl>
|
70 |
-
<dt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
<dd>
|
72 |
<div style="float:right">
|
73 |
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
@@ -79,9 +90,21 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
79 |
?>
|
80 |
<div class="publishpress-headline">
|
81 |
<span class="cme-subtext">
|
82 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
</span>
|
84 |
-
<span class="publishpress-thanks"> <?php printf( __( 'Thanks for using the %1$sPublishPress%2$s family of professional publishing tools.', 'capsman-enhanced'), '<a href="https://publishpress.com/" target="_blank">', '</a>' );?></span>
|
85 |
</div>
|
86 |
|
87 |
<?php
|
@@ -107,7 +130,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
107 |
|
108 |
<?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
|
109 |
|
110 |
-
<br /><div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('
|
111 |
<li>
|
112 |
<?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
|
113 |
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
@@ -118,7 +141,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
118 |
|
119 |
<li>
|
120 |
<?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
|
121 |
-
|
122 |
|
123 |
<li>
|
124 |
<?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
|
@@ -146,7 +169,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
146 |
|
147 |
<li>
|
148 |
<?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
|
149 |
-
|
150 |
|
151 |
<li>
|
152 |
<?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
|
@@ -164,9 +187,9 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
164 |
|
165 |
<?php
|
166 |
echo '<div>';
|
167 |
-
printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), '
|
168 |
echo ' • ';
|
169 |
-
printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), '
|
170 |
echo ' • ';
|
171 |
echo '<a href="#pp-hide">hide</a>';
|
172 |
echo '</div></div>';
|
@@ -182,13 +205,14 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
182 |
|
183 |
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
184 |
}
|
|
|
185 |
$capsman->reinstate_db_roles();
|
186 |
|
187 |
$current = get_role($default);
|
188 |
|
189 |
$rcaps = $current->capabilities;
|
190 |
|
191 |
-
$is_administrator = current_user_can( 'administrator' );
|
192 |
|
193 |
$custom_types = get_post_types( array( '_builtin' => false ), 'names' );
|
194 |
$custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
|
@@ -280,7 +304,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
280 |
echo '<li>';
|
281 |
echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
|
282 |
|
283 |
-
echo
|
284 |
|
285 |
foreach( array_keys($defined) as $item_type ) {
|
286 |
if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
|
@@ -303,7 +327,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
303 |
if ( ! count( $cap_properties[$cap_type][$item_type] ) )
|
304 |
continue;
|
305 |
|
306 |
-
echo
|
307 |
|
308 |
echo '<tr><th></th>';
|
309 |
|
@@ -390,15 +414,15 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
390 |
|
391 |
if ( $is_administrator || current_user_can($cap_name) ) {
|
392 |
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
393 |
-
$
|
394 |
} else {
|
395 |
-
$
|
396 |
}
|
397 |
|
398 |
$disabled = '';
|
399 |
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
400 |
|
401 |
-
$checkbox = '<input type="checkbox"
|
402 |
|
403 |
$type_caps [$cap_name] = true;
|
404 |
$display_row = true;
|
@@ -427,8 +451,9 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
427 |
|
428 |
if ('type' == $item_type) {
|
429 |
$type_metacaps[$type_obj->cap->read_post] = true;
|
430 |
-
$type_metacaps[$type_obj->cap->edit_post] =
|
431 |
-
$type_metacaps[$type_obj->cap->delete_post] =
|
|
|
432 |
} elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
|
433 |
$type_metacaps[$type_obj->cap->edit_term] = true;
|
434 |
$type_metacaps[$type_obj->cap->delete_term] = true;
|
@@ -450,6 +475,11 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
450 |
echo '</li>';
|
451 |
}
|
452 |
|
|
|
|
|
|
|
|
|
|
|
453 |
echo '</ul>';
|
454 |
|
455 |
// clicking on post type name toggles corresponding checkbox selections
|
@@ -561,16 +591,31 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
561 |
$all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
|
562 |
$all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
|
563 |
|
|
|
564 |
$publishpress_status_change_caps = array();
|
565 |
foreach( $all_capabilities as $cap_name ) {
|
566 |
if (0 === strpos($cap_name, 'status_change_')) {
|
567 |
$publishpress_status_change_caps []= $cap_name;
|
568 |
}
|
569 |
}
|
|
|
570 |
|
571 |
$plugin_caps = apply_filters('cme_plugin_capabilities',
|
572 |
-
|
573 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
array(
|
575 |
'edit_own_attachments',
|
576 |
'list_others_unattached_files',
|
@@ -606,20 +651,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
606 |
'set_posts_status',
|
607 |
)
|
608 |
),
|
609 |
-
|
610 |
-
array_merge(
|
611 |
-
array(
|
612 |
-
'edit_post_subscriptions',
|
613 |
-
'ppma_edit_orphan_post',
|
614 |
-
'pp_manage_roles',
|
615 |
-
'pp_set_notification_channel',
|
616 |
-
'pp_view_calendar',
|
617 |
-
'pp_view_content_overview',
|
618 |
-
'status_change',
|
619 |
-
),
|
620 |
-
$publishpress_status_change_caps
|
621 |
-
)
|
622 |
-
),
|
623 |
'WooCommerce' => apply_filters('cme_woocommerce_capabilities',
|
624 |
array(
|
625 |
'assign_product_terms',
|
@@ -708,11 +740,16 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
708 |
'view_woocommerce_reports',
|
709 |
)
|
710 |
),
|
711 |
-
|
|
|
712 |
|
713 |
foreach($plugin_caps as $plugin => $__plugin_caps) {
|
714 |
-
if (
|
715 |
-
|
|
|
|
|
|
|
|
|
716 |
}
|
717 |
|
718 |
echo '<h3 class="cme-cap-section">' . sprintf(__( '%s Capabilities', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
|
@@ -803,7 +840,9 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
803 |
|
804 |
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
805 |
|
806 |
-
|
|
|
|
|
807 |
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) )
|
808 |
continue;
|
809 |
|
@@ -894,7 +933,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
894 |
</table>
|
895 |
|
896 |
<?php
|
897 |
-
if (array_intersect(array_keys($type_metacaps), $all_capabilities)) {
|
898 |
|
899 |
$_title = esc_attr(__('Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect.'));
|
900 |
echo '<p> </p><h3 class="cme-cap-section" title="' . $_title . '">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
|
@@ -996,13 +1035,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
996 |
</select>
|
997 |
</span>
|
998 |
|
999 |
-
<?php if ( ! defined('PRESSPERMIT_ACTIVE') || capsman_get_pp_option('display_hints') ) :?>
|
1000 |
-
<span class="cme-subtext" style="float:right">
|
1001 |
-
<?php _e( 'Note: Underscores replace spaces in stored capability name ("edit users" => "edit_users").', 'capsman-enhanced' ); ?>
|
1002 |
-
</span>
|
1003 |
-
<?php endif;?>
|
1004 |
</div>
|
1005 |
-
|
1006 |
</dd>
|
1007 |
</dl>
|
1008 |
|
@@ -1029,6 +1062,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1029 |
<p><select name="role">
|
1030 |
<?php
|
1031 |
foreach ( $roles as $role => $name ) {
|
|
|
1032 |
echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' </option>';
|
1033 |
}
|
1034 |
?>
|
@@ -1040,10 +1074,16 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1040 |
/* <![CDATA[ */
|
1041 |
jQuery(document).ready( function($) {
|
1042 |
$('select[name="role"]').val('<?php echo $default;?>');
|
|
|
|
|
|
|
|
|
1043 |
});
|
1044 |
/* ]]> */
|
1045 |
</script>
|
1046 |
|
|
|
|
|
1047 |
<dl>
|
1048 |
<dt><?php _e('Create New Role', 'capsman-enhanced'); ?></dt>
|
1049 |
<dd style="text-align:center;">
|
@@ -1061,7 +1101,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1061 |
</dl>
|
1062 |
|
1063 |
<dl>
|
1064 |
-
<dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', 'capsman-enhanced') : printf(
|
1065 |
<dd style="text-align:center;">
|
1066 |
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1067 |
<p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
@@ -1084,12 +1124,12 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1084 |
</dd>
|
1085 |
</dl>
|
1086 |
|
1087 |
-
<dl class="cme-backup-tool">
|
1088 |
<dt><?php _e('Backup Tool', 'capsman-enhanced'); ?></dt>
|
1089 |
<dd style="text-align:center;">
|
1090 |
-
<p><a href="
|
1091 |
</dd>
|
1092 |
-
</dl>
|
1093 |
|
1094 |
<dl>
|
1095 |
<dt><?php _e('Related Permissions Plugins', 'capsman-enhanced'); ?></dt>
|
@@ -1098,7 +1138,7 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1098 |
<li><a href="https://publishpress.com/ma/" target="_blank"><?php _e('Multiple Authors', 'capsman-enhanced');?></a></li>
|
1099 |
</li>
|
1100 |
|
1101 |
-
<li><a href="#pp-more"><?php _e('
|
1102 |
</li>
|
1103 |
|
1104 |
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=publishpress&TB_iframe=true&width=640&height=678";
|
@@ -1120,6 +1160,8 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1120 |
<?php
|
1121 |
$pp_ui->pp_types_ui( $defined['type'] );
|
1122 |
$pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
|
|
|
|
|
1123 |
?>
|
1124 |
</td>
|
1125 |
</tr>
|
@@ -1127,7 +1169,10 @@ if( defined('PRESSPERMIT_ACTIVE') ) {
|
|
1127 |
</fieldset>
|
1128 |
</form>
|
1129 |
|
1130 |
-
<?php
|
|
|
|
|
|
|
1131 |
</div>
|
1132 |
|
1133 |
<?php
|
@@ -1158,45 +1203,3 @@ function cme_plugin_info_url( $plugin_slug ) {
|
|
1158 |
$_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
|
1159 |
return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1160 |
}
|
1161 |
-
|
1162 |
-
function cme_publishpressFooter() {
|
1163 |
-
?>
|
1164 |
-
<footer>
|
1165 |
-
|
1166 |
-
<div class="pp-rating">
|
1167 |
-
<a href="https://wordpress.org/support/plugin/capability-manager-enhanced/reviews/#new-post" target="_blank" rel="noopener noreferrer">
|
1168 |
-
<?php printf(
|
1169 |
-
__('If you like %s, please leave us a %s rating. Thank you!', 'capsman-enhanced'),
|
1170 |
-
'<strong>Capability Manager Enhanced</strong>',
|
1171 |
-
'<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>'
|
1172 |
-
);
|
1173 |
-
?>
|
1174 |
-
</a>
|
1175 |
-
</div>
|
1176 |
-
|
1177 |
-
<hr>
|
1178 |
-
<nav>
|
1179 |
-
<ul>
|
1180 |
-
<li><a href="https://publishpress.com/capability-manager/" target="_blank" rel="noopener noreferrer" title="<?php _e('About Capability Manager Enhanced', 'capsman-enhanced');?>"><?php _e('About', 'capsman-enhanced');?>
|
1181 |
-
</a></li>
|
1182 |
-
<li><a href="https://publishpress.com/knowledge-base/how-to-use-capability-manager/" target="_blank" rel="noopener noreferrer" title="<?php _e('Capability Manager Enhanced Documentation', 'capsman-enhanced');?>"><?php _e('Documentation', 'capsman-enhanced');?>
|
1183 |
-
</a></li>
|
1184 |
-
<li><a href="https://publishpress.com/contact" target="_blank" rel="noopener noreferrer" title="<?php _e('Contact the PublishPress team', 'capsman-enhanced');?>"><?php _e('Contact', 'capsman-enhanced');?>
|
1185 |
-
</a></li>
|
1186 |
-
<li><a href="https://twitter.com/publishpresscom" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-twitter"></span>
|
1187 |
-
</a></li>
|
1188 |
-
<li><a href="https://facebook.com/publishpress" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-facebook"></span>
|
1189 |
-
</a></li>
|
1190 |
-
</ul>
|
1191 |
-
</nav>
|
1192 |
-
|
1193 |
-
<div class="pp-pressshack-logo">
|
1194 |
-
<a href="https://publishpress.com" target="_blank" rel="noopener noreferrer">
|
1195 |
-
|
1196 |
-
<img src="<?php echo plugins_url('', CME_FILE) . '/common/img/publishpress-logo.png';?>" />
|
1197 |
-
</a>
|
1198 |
-
</div>
|
1199 |
-
|
1200 |
-
</footer>
|
1201 |
-
<?php
|
1202 |
-
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
* General Admin for Role Capabilities.
|
4 |
* Provides admin pages to create and manage roles and capabilities.
|
5 |
*
|
6 |
* @author Jordi Canals, Kevin Behrens
|
7 |
+
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
|
8 |
* @license GNU General Public License version 2
|
9 |
* @link https://publishpress.com
|
10 |
*
|
11 |
*
|
12 |
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
+
* Modifications Copyright 2020, PublishPress <help@publishpress.com>
|
14 |
*
|
15 |
* This program is free software; you can redistribute it and/or
|
16 |
* modify it under the terms of the GNU General Public License
|
27 |
|
28 |
global $capsman, $cme_cap_helper, $current_user;
|
29 |
|
30 |
+
do_action('publishpress-caps_manager-load');
|
31 |
+
|
32 |
$roles = $this->roles;
|
33 |
$default = $this->current;
|
34 |
|
49 |
$pp_metagroup_caps = array();
|
50 |
}
|
51 |
?>
|
52 |
+
<div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
|
53 |
<?php if( defined('PRESSPERMIT_ACTIVE') ) :
|
54 |
pp_icon();
|
55 |
$style = 'style="height:60px;"';
|
60 |
<div id="icon-capsman-admin" class="icon32"></div>
|
61 |
<?php endif; ?>
|
62 |
|
63 |
+
<h1 <?php echo $style;?>><?php _e('Role Capabilities', 'capsman-enhanced') ?></h1>
|
64 |
|
65 |
+
<form id="publishpress_caps_form" method="post" action="admin.php?page=<?php echo $this->ID ?>">
|
66 |
<?php wp_nonce_field('capsman-general-manager'); ?>
|
67 |
<fieldset>
|
68 |
<table id="akmin">
|
69 |
<tr>
|
70 |
<td class="content">
|
71 |
<dl>
|
72 |
+
<dt>
|
73 |
+
<?php
|
74 |
+
$role_caption = (defined('PUBLISHPRESS_VERSION'))
|
75 |
+
? '<a href="' . admin_url("admin.php?page=pp-manage-roles&action=edit-role&role-id={$this->current}") . '">' . translate_user_role($roles[$default]) . '</a>'
|
76 |
+
: translate_user_role($roles[$default]);
|
77 |
+
|
78 |
+
printf(__('Capabilities for %s', 'capsman-enhanced'), $role_caption);
|
79 |
+
?>
|
80 |
+
</dt>
|
81 |
+
|
82 |
<dd>
|
83 |
<div style="float:right">
|
84 |
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
90 |
?>
|
91 |
<div class="publishpress-headline">
|
92 |
<span class="cme-subtext">
|
93 |
+
<?php
|
94 |
+
$msg = __( '<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation.', 'capsman-enhanced' );
|
95 |
+
|
96 |
+
if (defined('PRESSPERMIT_ACTIVE') && function_exists('presspermit')) {
|
97 |
+
if ($group = presspermit()->groups()->getMetagroup('wp_role', $this->current)) {
|
98 |
+
$msg = sprintf(
|
99 |
+
__('<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s.', 'capsman-enhanced'),
|
100 |
+
'<a href="' . admin_url("admin.php?page=presspermit-edit-permissions&action=edit&agent_id={$group->ID}") . '">',
|
101 |
+
'</a>'
|
102 |
+
);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
echo $msg;
|
106 |
+
?>
|
107 |
</span>
|
|
|
108 |
</div>
|
109 |
|
110 |
<?php
|
130 |
|
131 |
<?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
|
132 |
|
133 |
+
<br /><div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('PublishPress Permissions', 'capsman-enhanced');?>" /></a></div><div class="features-wrap"><ul class="pp-features">
|
134 |
<li>
|
135 |
<?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
|
136 |
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
141 |
|
142 |
<li>
|
143 |
<?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
|
144 |
+
</li>
|
145 |
|
146 |
<li>
|
147 |
<?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
|
169 |
|
170 |
<li>
|
171 |
<?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
|
172 |
+
</li>
|
173 |
|
174 |
<li>
|
175 |
<?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
|
187 |
|
188 |
<?php
|
189 |
echo '<div>';
|
190 |
+
printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a></span>' );
|
191 |
echo ' • ';
|
192 |
+
printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a>' );
|
193 |
echo ' • ';
|
194 |
echo '<a href="#pp-hide">hide</a>';
|
195 |
echo '</div></div>';
|
205 |
|
206 |
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
207 |
}
|
208 |
+
|
209 |
$capsman->reinstate_db_roles();
|
210 |
|
211 |
$current = get_role($default);
|
212 |
|
213 |
$rcaps = $current->capabilities;
|
214 |
|
215 |
+
$is_administrator = current_user_can( 'administrator' ) || (is_multisite() && is_super_admin());
|
216 |
|
217 |
$custom_types = get_post_types( array( '_builtin' => false ), 'names' );
|
218 |
$custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
|
304 |
echo '<li>';
|
305 |
echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
|
306 |
|
307 |
+
echo "<div class='cme-cap-type-tables cme-cap-type-tables-$cap_type'>";
|
308 |
|
309 |
foreach( array_keys($defined) as $item_type ) {
|
310 |
if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
|
327 |
if ( ! count( $cap_properties[$cap_type][$item_type] ) )
|
328 |
continue;
|
329 |
|
330 |
+
echo "<table class='cme-typecaps cme-typecaps-$cap_type'>";
|
331 |
|
332 |
echo '<tr><th></th>';
|
333 |
|
414 |
|
415 |
if ( $is_administrator || current_user_can($cap_name) ) {
|
416 |
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
417 |
+
$title = ' title="' . sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name ) . '"';
|
418 |
} else {
|
419 |
+
$title = ' title="' . $cap_name . '"';
|
420 |
}
|
421 |
|
422 |
$disabled = '';
|
423 |
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
424 |
|
425 |
+
$checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
|
426 |
|
427 |
$type_caps [$cap_name] = true;
|
428 |
$display_row = true;
|
451 |
|
452 |
if ('type' == $item_type) {
|
453 |
$type_metacaps[$type_obj->cap->read_post] = true;
|
454 |
+
$type_metacaps[$type_obj->cap->edit_post] = isset($type_obj->cap->edit_posts) && ($type_obj->cap->edit_post != $type_obj->cap->edit_posts);
|
455 |
+
$type_metacaps[$type_obj->cap->delete_post] = isset($type_obj->cap->delete_posts) && ($type_obj->cap->delete_post != $type_obj->cap->delete_posts);
|
456 |
+
|
457 |
} elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
|
458 |
$type_metacaps[$type_obj->cap->edit_term] = true;
|
459 |
$type_metacaps[$type_obj->cap->delete_term] = true;
|
475 |
echo '</li>';
|
476 |
}
|
477 |
|
478 |
+
|
479 |
+
do_action('publishpress-caps_manager_postcaps_section', compact('current', 'rcaps', 'pp_metagroup_caps', 'is_administrator', 'default_caps', 'custom_types', 'defined', 'unfiltered', 'pp_metagroup_caps'));
|
480 |
+
|
481 |
+
$type_caps = apply_filters('publishpress_caps_manager_typecaps', $type_caps);
|
482 |
+
|
483 |
echo '</ul>';
|
484 |
|
485 |
// clicking on post type name toggles corresponding checkbox selections
|
591 |
$all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
|
592 |
$all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
|
593 |
|
594 |
+
/*
|
595 |
$publishpress_status_change_caps = array();
|
596 |
foreach( $all_capabilities as $cap_name ) {
|
597 |
if (0 === strpos($cap_name, 'status_change_')) {
|
598 |
$publishpress_status_change_caps []= $cap_name;
|
599 |
}
|
600 |
}
|
601 |
+
*/
|
602 |
|
603 |
$plugin_caps = apply_filters('cme_plugin_capabilities',
|
604 |
+
[
|
605 |
+
'PublishPress' => apply_filters('cme_publishpress_capabilities',
|
606 |
+
array(
|
607 |
+
'edit_metadata',
|
608 |
+
'edit_post_subscriptions',
|
609 |
+
'ppma_edit_orphan_post',
|
610 |
+
'pp_manage_roles',
|
611 |
+
'pp_set_notification_channel',
|
612 |
+
'pp_view_calendar',
|
613 |
+
'pp_view_content_overview',
|
614 |
+
'status_change',
|
615 |
+
)
|
616 |
+
),
|
617 |
+
|
618 |
+
'PublishPress Permissions' => apply_filters('cme_presspermit_capabilities',
|
619 |
array(
|
620 |
'edit_own_attachments',
|
621 |
'list_others_unattached_files',
|
651 |
'set_posts_status',
|
652 |
)
|
653 |
),
|
654 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
'WooCommerce' => apply_filters('cme_woocommerce_capabilities',
|
656 |
array(
|
657 |
'assign_product_terms',
|
740 |
'view_woocommerce_reports',
|
741 |
)
|
742 |
),
|
743 |
+
]
|
744 |
+
);
|
745 |
|
746 |
foreach($plugin_caps as $plugin => $__plugin_caps) {
|
747 |
+
if (!is_multisite() || !is_super_admin()) {
|
748 |
+
if (!$_plugin_caps = array_fill_keys( array_intersect($__plugin_caps, $all_capabilities), true )) {
|
749 |
+
continue;
|
750 |
+
}
|
751 |
+
} else {
|
752 |
+
$_plugin_caps = array_fill_keys($__plugin_caps, true);
|
753 |
}
|
754 |
|
755 |
echo '<h3 class="cme-cap-section">' . sprintf(__( '%s Capabilities', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
|
840 |
|
841 |
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
842 |
|
843 |
+
$additional_caps = apply_filters('publishpress_caps_manage_additional_caps', $this->capabilities);
|
844 |
+
|
845 |
+
foreach ($additional_caps as $cap_name => $cap) :
|
846 |
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) )
|
847 |
continue;
|
848 |
|
933 |
</table>
|
934 |
|
935 |
<?php
|
936 |
+
if (array_intersect(array_keys(array_filter($type_metacaps)), $all_capabilities)) {
|
937 |
|
938 |
$_title = esc_attr(__('Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect.'));
|
939 |
echo '<p> </p><h3 class="cme-cap-section" title="' . $_title . '">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
|
1035 |
</select>
|
1036 |
</span>
|
1037 |
|
|
|
|
|
|
|
|
|
|
|
1038 |
</div>
|
|
|
1039 |
</dd>
|
1040 |
</dl>
|
1041 |
|
1062 |
<p><select name="role">
|
1063 |
<?php
|
1064 |
foreach ( $roles as $role => $name ) {
|
1065 |
+
$name = translate_user_role($name);
|
1066 |
echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' </option>';
|
1067 |
}
|
1068 |
?>
|
1074 |
/* <![CDATA[ */
|
1075 |
jQuery(document).ready( function($) {
|
1076 |
$('select[name="role"]').val('<?php echo $default;?>');
|
1077 |
+
|
1078 |
+
$('input.button[name="LoadRole"]').click(function(){
|
1079 |
+
$('#publishpress_caps_form').attr('action', 'admin.php?page=capsman&role=' + $('select[name="role"]').val());
|
1080 |
+
});
|
1081 |
});
|
1082 |
/* ]]> */
|
1083 |
</script>
|
1084 |
|
1085 |
+
<?php do_action('publishpress-caps_sidebar_top');?>
|
1086 |
+
|
1087 |
<dl>
|
1088 |
<dt><?php _e('Create New Role', 'capsman-enhanced'); ?></dt>
|
1089 |
<dd style="text-align:center;">
|
1101 |
</dl>
|
1102 |
|
1103 |
<dl>
|
1104 |
+
<dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', 'capsman-enhanced') : printf('Copy %s Role', translate_user_role($roles[$default])); ?></dt>
|
1105 |
<dd style="text-align:center;">
|
1106 |
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1107 |
<p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
1124 |
</dd>
|
1125 |
</dl>
|
1126 |
|
1127 |
+
<!-- <dl class="cme-backup-tool">
|
1128 |
<dt><?php _e('Backup Tool', 'capsman-enhanced'); ?></dt>
|
1129 |
<dd style="text-align:center;">
|
1130 |
+
<p><a href="admin.php?page=capsman-tool"><?php _e('Backup / Restore Roles', 'capsman-enhanced');?></a></p>
|
1131 |
</dd>
|
1132 |
+
</dl> -->
|
1133 |
|
1134 |
<dl>
|
1135 |
<dt><?php _e('Related Permissions Plugins', 'capsman-enhanced'); ?></dt>
|
1138 |
<li><a href="https://publishpress.com/ma/" target="_blank"><?php _e('Multiple Authors', 'capsman-enhanced');?></a></li>
|
1139 |
</li>
|
1140 |
|
1141 |
+
<li><a href="#pp-more"><?php _e('PublishPress Permissions', 'capsman-enhanced');?></a>
|
1142 |
</li>
|
1143 |
|
1144 |
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=publishpress&TB_iframe=true&width=640&height=678";
|
1160 |
<?php
|
1161 |
$pp_ui->pp_types_ui( $defined['type'] );
|
1162 |
$pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
|
1163 |
+
|
1164 |
+
do_action('publishpress-caps_sidebar_bottom');
|
1165 |
?>
|
1166 |
</td>
|
1167 |
</tr>
|
1169 |
</fieldset>
|
1170 |
</form>
|
1171 |
|
1172 |
+
<?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
|
1173 |
+
cme_publishpressFooter();
|
1174 |
+
}
|
1175 |
+
?>
|
1176 |
</div>
|
1177 |
|
1178 |
<?php
|
1203 |
$_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
|
1204 |
return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/backup.php
CHANGED
@@ -11,28 +11,31 @@
|
|
11 |
* @package Alkivia
|
12 |
* @subpackage CapsMan
|
13 |
*
|
14 |
-
|
15 |
-
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
*/
|
29 |
|
30 |
?>
|
31 |
-
|
|
|
32 |
<div id="icon-capsman-admin" class="icon32"></div>
|
33 |
-
<h2><?php printf( __('Backup Tool for %1$
|
34 |
|
35 |
-
<form method="post" action="
|
36 |
<?php wp_nonce_field('capsman-backup-tool'); ?>
|
37 |
<fieldset>
|
38 |
<table id="akmin">
|
@@ -113,7 +116,7 @@
|
|
113 |
<?php
|
114 |
$role_caption = $props['name'];
|
115 |
if ( empty( $wp_roles->role_objects[$role] ) ) $role_caption = "<span class='cme-plus' style='color:green;font-weight:800'>$role_caption</span>";?>
|
116 |
-
<h4><?php printf( __( '%s (level %s)', 'capsman-enhanced' ), $role_caption, $level );?></h4>
|
117 |
<ul style="list-style:disc;padding-left:30px">
|
118 |
|
119 |
<?php
|
@@ -141,7 +144,7 @@
|
|
141 |
<?php
|
142 |
_e('If you have installed any plugin that adds new roles or capabilities, these will be lost.', 'capsman-enhanced')?><br />
|
143 |
<strong><?php if ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) _e('It is recommended to use this only as a last resource!'); else echo('It is recommended to use this only as a last resort!');?></strong></p>
|
144 |
-
<p style="text-align:center;"><a class="ak-delete" title="<?php echo esc_attr(__('Reset Roles and Capabilities to WordPress defaults', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("
|
145 |
|
146 |
</dd>
|
147 |
</dl>
|
@@ -151,4 +154,9 @@
|
|
151 |
</table>
|
152 |
</fieldset>
|
153 |
</form>
|
154 |
-
|
|
|
|
|
|
|
|
|
|
11 |
* @package Alkivia
|
12 |
* @subpackage CapsMan
|
13 |
*
|
14 |
+
*
|
15 |
+
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
16 |
+
*
|
17 |
+
* Modifications Copyright 2020, PublishPress <help@publishpress.com>
|
18 |
+
*
|
19 |
+
* This program is free software; you can redistribute it and/or
|
20 |
+
* modify it under the terms of the GNU General Public License
|
21 |
+
* version 2 as published by the Free Software Foundation.
|
22 |
+
*
|
23 |
+
* This program is distributed in the hope that it will be useful,
|
24 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
25 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
26 |
+
* GNU General Public License for more details.
|
27 |
+
*
|
28 |
+
* You should have received a copy of the GNU General Public License
|
29 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
30 |
*/
|
31 |
|
32 |
?>
|
33 |
+
|
34 |
+
<div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
|
35 |
<div id="icon-capsman-admin" class="icon32"></div>
|
36 |
+
<h2><?php printf( __('Backup Tool for %1$sPublishPress Capabilities%2$s', 'capsman-enhanced'), '<a href="admin.php?page=capsman">', '</a>' );?></h2>
|
37 |
|
38 |
+
<form method="post" action="admin.php?page=<?php echo $this->ID ?>-tool">
|
39 |
<?php wp_nonce_field('capsman-backup-tool'); ?>
|
40 |
<fieldset>
|
41 |
<table id="akmin">
|
116 |
<?php
|
117 |
$role_caption = $props['name'];
|
118 |
if ( empty( $wp_roles->role_objects[$role] ) ) $role_caption = "<span class='cme-plus' style='color:green;font-weight:800'>$role_caption</span>";?>
|
119 |
+
<h4><?php printf( __( '%s (level %s)', 'capsman-enhanced' ), translate_user_role($role_caption), $level );?></h4>
|
120 |
<ul style="list-style:disc;padding-left:30px">
|
121 |
|
122 |
<?php
|
144 |
<?php
|
145 |
_e('If you have installed any plugin that adds new roles or capabilities, these will be lost.', 'capsman-enhanced')?><br />
|
146 |
<strong><?php if ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) _e('It is recommended to use this only as a last resource!'); else echo('It is recommended to use this only as a last resort!');?></strong></p>
|
147 |
+
<p style="text-align:center;"><a class="ak-delete" title="<?php echo esc_attr(__('Reset Roles and Capabilities to WordPress defaults', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}-tool&action=reset-defaults", 'capsman-reset-defaults'); ?>" onclick="if ( confirm('<?php echo esc_js(__("You are about to reset Roles and Capabilities to WordPress defaults.\n 'Cancel' to stop, 'OK' to reset.", 'capsman-enhanced')); ?>') ) { return true;}return false;"><?php _e('Reset to WordPress defaults', 'capsman-enhanced')?></a>
|
148 |
|
149 |
</dd>
|
150 |
</dl>
|
154 |
</table>
|
155 |
</fieldset>
|
156 |
</form>
|
157 |
+
|
158 |
+
<?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
|
159 |
+
cme_publishpressFooter();
|
160 |
+
}
|
161 |
+
?>
|
162 |
+
</div>
|
includes/filters-wp_rest_workarounds.php
CHANGED
@@ -5,22 +5,29 @@ namespace PublishPress\Capabilities;
|
|
5 |
* PublishPress\Capabilities\WP_REST_Workarounds class
|
6 |
*
|
7 |
* @author Kevin Behrens
|
8 |
-
* @copyright Copyright (c)
|
9 |
-
* @link https://publishpress.com
|
10 |
*
|
11 |
*/
|
12 |
class WP_REST_Workarounds
|
13 |
{
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
|
17 |
-
function __construct() {
|
18 |
add_filter('rest_pre_dispatch', [$this, 'fltRestPreDispatch'], 10, 3);
|
19 |
add_filter('user_has_cap', [$this, 'fltPublishCapReplacement'], 5, 3);
|
20 |
|
21 |
-
add_filter('
|
22 |
-
|
|
|
23 |
|
|
|
|
|
|
|
24 |
/**
|
25 |
* Work around Gutenberg editor enforcing publish_posts capability instead of edit_published_posts.
|
26 |
*
|
@@ -28,7 +35,9 @@ class WP_REST_Workarounds
|
|
28 |
* - The query pertains to a specific post
|
29 |
* - The post type and its capabilities are defined and match the current publish capability requirement
|
30 |
* - The post is already published with a public status, or scheduled
|
31 |
-
|
|
|
|
|
32 |
* @author Kevin Behrens
|
33 |
* @link https://core.trac.wordpress.org/ticket/47443
|
34 |
* @link https://github.com/WordPress/gutenberg/issues/13342
|
@@ -38,8 +47,14 @@ class WP_REST_Workarounds
|
|
38 |
*/
|
39 |
public function fltPublishCapReplacement($wp_sitecaps, $reqd_caps, $args)
|
40 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
if ($reqd_cap = reset($reqd_caps)) {
|
42 |
-
// slight compromise for perf: apply this workaround only when publish_posts
|
43 |
if (0 === strpos($reqd_cap, 'publish_')) {
|
44 |
if (!empty($wp_sitecaps[$reqd_cap])) {
|
45 |
return $wp_sitecaps;
|
@@ -68,48 +83,129 @@ class WP_REST_Workarounds
|
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
-
*
|
|
|
|
|
|
|
|
|
|
|
72 |
*
|
73 |
-
*
|
74 |
-
*
|
75 |
-
* @param
|
76 |
*/
|
77 |
-
function fltPostStatus($post_status) {
|
78 |
global $current_user;
|
79 |
-
|
80 |
-
if ($_post = get_post($this->getPostID())) {
|
81 |
-
$type_obj = get_post_type_object($_post->post_type);
|
82 |
-
$status_obj = get_post_status_object($_post->post_status);
|
83 |
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
$post_status = $_post->post_status;
|
87 |
}
|
|
|
|
|
88 |
}
|
89 |
}
|
90 |
|
91 |
return $post_status;
|
92 |
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
-
|
103 |
-
return ('auto-draft' == $post->post_status) ? 0 : $post->ID;
|
104 |
-
} elseif (isset($_REQUEST['post'])) {
|
105 |
-
return (int)$_REQUEST['post'];
|
106 |
-
} elseif (isset($_REQUEST['post_ID'])) {
|
107 |
-
return (int)$_REQUEST['post_ID'];
|
108 |
-
} elseif (isset($_REQUEST['post_id'])) {
|
109 |
-
return (int)$_REQUEST['post_id'];
|
110 |
-
}
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
public function fltRestPreDispatch($rest_response, $rest_server, $request)
|
114 |
{
|
115 |
$method = $request->get_method();
|
@@ -136,6 +232,9 @@ class WP_REST_Workarounds
|
|
136 |
}
|
137 |
|
138 |
$this->is_posts_request = true;
|
|
|
|
|
|
|
139 |
break 2;
|
140 |
}
|
141 |
}
|
@@ -143,4 +242,26 @@ class WP_REST_Workarounds
|
|
143 |
|
144 |
return $rest_response;
|
145 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
5 |
* PublishPress\Capabilities\WP_REST_Workarounds class
|
6 |
*
|
7 |
* @author Kevin Behrens
|
8 |
+
* @copyright Copyright (c) 2020, PublishPress
|
9 |
+
* @link https://publishpress.com/
|
10 |
*
|
11 |
*/
|
12 |
class WP_REST_Workarounds
|
13 |
{
|
14 |
+
private $post_id = 0;
|
15 |
+
private $is_posts_request = false;
|
16 |
+
private $is_view_method = false;
|
17 |
+
private $params = [];
|
18 |
+
private $skip_filtering = false;
|
19 |
|
20 |
+
public function __construct() {
|
21 |
add_filter('rest_pre_dispatch', [$this, 'fltRestPreDispatch'], 10, 3);
|
22 |
add_filter('user_has_cap', [$this, 'fltPublishCapReplacement'], 5, 3);
|
23 |
|
24 |
+
add_filter('wp_insert_post_data', [$this, 'fltInsertPostData'], 10, 2);
|
25 |
+
add_filter('edit_post_status', [$this, 'fltPostStatus'], 10, 2);
|
26 |
+
add_filter('user_has_cap', [$this, 'fltRegulateUnpublish'], 5, 3);
|
27 |
|
28 |
+
add_action('admin_print_styles-post.php', [$this, 'actAdminPrintScripts']);
|
29 |
+
}
|
30 |
+
|
31 |
/**
|
32 |
* Work around Gutenberg editor enforcing publish_posts capability instead of edit_published_posts.
|
33 |
*
|
35 |
* - The query pertains to a specific post
|
36 |
* - The post type and its capabilities are defined and match the current publish capability requirement
|
37 |
* - The post is already published with a public status, or scheduled
|
38 |
+
*
|
39 |
+
* Filter hook: 'user_has_cap'
|
40 |
+
*
|
41 |
* @author Kevin Behrens
|
42 |
* @link https://core.trac.wordpress.org/ticket/47443
|
43 |
* @link https://github.com/WordPress/gutenberg/issues/13342
|
47 |
*/
|
48 |
public function fltPublishCapReplacement($wp_sitecaps, $reqd_caps, $args)
|
49 |
{
|
50 |
+
if ($this->skip_filtering) {
|
51 |
+
return $wp_sitecaps;
|
52 |
+
}
|
53 |
+
|
54 |
+
$reqd_caps = (array) $reqd_caps;
|
55 |
+
|
56 |
if ($reqd_cap = reset($reqd_caps)) {
|
57 |
+
// slight compromise for perf: apply this workaround only when cap->publish_posts property for post type follows typical pattern (publish_*)
|
58 |
if (0 === strpos($reqd_cap, 'publish_')) {
|
59 |
if (!empty($wp_sitecaps[$reqd_cap])) {
|
60 |
return $wp_sitecaps;
|
83 |
}
|
84 |
|
85 |
/**
|
86 |
+
* Work around WordPress allowing user who can "edit_published_posts" but not "publish_posts" to unpublish a post.
|
87 |
+
*
|
88 |
+
* This is hooked to the edit_post_status filter and also called internally from REST update_item capability check (for Gutenberg)
|
89 |
+
* and wp_insert_post_data (for Classic Editor and Quick Edit)
|
90 |
+
*
|
91 |
+
* Filter hook: 'edit_post_status'
|
92 |
*
|
93 |
+
* @author Kevin Behrens
|
94 |
+
* @param int $post_status Post status being set
|
95 |
+
* @param int $post_id ID of post being modified
|
96 |
*/
|
97 |
+
public function fltPostStatus($post_status, $post_id) {
|
98 |
global $current_user;
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
$new_status_obj = get_post_status_object($post_status);
|
101 |
+
if (!$new_status_obj || !empty($new_status_obj->internal)) {
|
102 |
+
return $post_status;
|
103 |
+
}
|
104 |
+
|
105 |
+
if (!$_post = get_post($post_id)) {
|
106 |
+
return $post_status;
|
107 |
+
}
|
108 |
+
|
109 |
+
$type_obj = get_post_type_object($_post->post_type);
|
110 |
+
$status_obj = get_post_status_object($_post->post_status);
|
111 |
+
|
112 |
+
if ($type_obj && $status_obj && (!empty($status_obj->public) || !empty($status_obj->private) || 'future' == $_post->post_status)) {
|
113 |
+
// Apply this workaround only if current user has $type_obj->cap->edit_published_posts
|
114 |
+
if (isset($type_obj->cap->edit_published_posts) && !empty($current_user->allcaps[$type_obj->cap->edit_published_posts])) {
|
115 |
+
$this->skip_filtering = true;
|
116 |
+
|
117 |
+
if (!current_user_can($type_obj->cap->publish_posts)) {
|
118 |
$post_status = $_post->post_status;
|
119 |
}
|
120 |
+
|
121 |
+
$this->skip_filtering = false;
|
122 |
}
|
123 |
}
|
124 |
|
125 |
return $post_status;
|
126 |
}
|
127 |
|
128 |
+
/**
|
129 |
+
* Regulate post unpublishing on Classic Editor and Quick Edit updates:
|
130 |
+
* If a user can't publish a post, don't let them unpublish it either.
|
131 |
+
*
|
132 |
+
* Filter hook: 'wp_insert_post_data'
|
133 |
+
*
|
134 |
+
* @param array $data Parsed array of Post data being set
|
135 |
+
* @param array $postarr ARray of current post data
|
136 |
+
*/
|
137 |
+
public function fltInsertPostData($data, $postarr) {
|
138 |
+
if (!empty($data['post_status']) && !empty($postarr['post_ID'])) {
|
139 |
+
$data['post_status'] = $this->fltPostStatus($data['post_status'], $postarr['post_ID']);
|
140 |
+
}
|
141 |
|
142 |
+
return $data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Regulate post unpublishing on Gutenberg "Switch to Draft"
|
147 |
+
* If a user can't publish a post, don't let them unpublish it either.
|
148 |
+
*
|
149 |
+
* Filter hook: user_has_cap
|
150 |
+
*
|
151 |
+
* @param array $wp_sitecaps Array of user capabilities acknowledged for this request.
|
152 |
+
* @param array $reqd_caps Capability requirements
|
153 |
+
* @param array $args Additional arguments passed into user_has_cap filter
|
154 |
+
*/
|
155 |
+
public function fltRegulateUnpublish($wp_sitecaps, $reqd_caps, $args)
|
156 |
+
{
|
157 |
+
if (!defined('REST_REQUEST') || !REST_REQUEST || !$this->is_posts_request || !$this->post_id || $this->skip_filtering) {
|
158 |
+
return $wp_sitecaps;
|
159 |
+
}
|
160 |
|
161 |
+
if ($reqd_cap = reset($reqd_caps)) {
|
162 |
+
// slight compromise for perf: apply this workaround only when cap->edit_published_posts property for post type follows typical pattern (edit_published_*)
|
163 |
+
if (0 === strpos($reqd_cap, 'edit_published_')) {
|
164 |
+
if ($this->params && !empty($this->params['status'])) {
|
165 |
+
$set_status = $this->fltPostStatus($this->params['status'], $this->post_id);
|
166 |
+
if ($set_status != $this->params['status']) {
|
167 |
+
unset($wp_sitecaps[$reqd_cap]);
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
return $wp_sitecaps;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* If we are blocking Gutenberg "Switch to Draft" by capability filtering, also hide the button
|
178 |
+
*
|
179 |
+
* Action hook: 'admin_print_styles-post.php'
|
180 |
+
*/
|
181 |
+
public function actAdminPrintScripts() {
|
182 |
+
global $current_user, $post;
|
183 |
+
|
184 |
+
if (empty($post) || !did_action('enqueue_block_editor_assets')) {
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
$status_obj = get_post_status_object($post->post_status);
|
189 |
+
|
190 |
+
if (!$status_obj || (empty($status_obj->public) && empty($status_obj->private))) {
|
191 |
+
return;
|
192 |
+
}
|
193 |
+
|
194 |
+
$type_obj = get_post_type_object($post->post_type);
|
195 |
+
$this->skip_filtering = true;
|
196 |
+
|
197 |
+
if ($type_obj && !current_user_can($type_obj->cap->publish_posts) && current_user_can($type_obj->cap->edit_published_posts)): ?>
|
198 |
+
<style type="text/css">button.editor-post-switch-to-draft {display:none;}</style>
|
199 |
+
<?php endif;
|
200 |
+
|
201 |
+
$this->skip_filtering = false;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Log REST query parameters for possible use by subsequent filters
|
206 |
+
*
|
207 |
+
* Action hook: 'rest_pre_dispatch'
|
208 |
+
*/
|
209 |
public function fltRestPreDispatch($rest_response, $rest_server, $request)
|
210 |
{
|
211 |
$method = $request->get_method();
|
232 |
}
|
233 |
|
234 |
$this->is_posts_request = true;
|
235 |
+
$this->is_view_method = in_array($method, [\WP_REST_Server::READABLE, 'GET']);
|
236 |
+
$this->params = $request->get_params();
|
237 |
+
|
238 |
break 2;
|
239 |
}
|
240 |
}
|
242 |
|
243 |
return $rest_response;
|
244 |
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Determine the Post ID, if any, which this query pertains to
|
248 |
+
*/
|
249 |
+
private function getPostID()
|
250 |
+
{
|
251 |
+
global $post;
|
252 |
+
|
253 |
+
if (defined('REST_REQUEST') && REST_REQUEST && $this->is_posts_request) {
|
254 |
+
return $this->post_id;
|
255 |
+
}
|
256 |
+
|
257 |
+
if (!empty($post) && is_object($post)) {
|
258 |
+
return ('auto-draft' == $post->post_status) ? 0 : $post->ID;
|
259 |
+
} elseif (isset($_REQUEST['post'])) {
|
260 |
+
return (int)$_REQUEST['post'];
|
261 |
+
} elseif (isset($_REQUEST['post_ID'])) {
|
262 |
+
return (int)$_REQUEST['post_ID'];
|
263 |
+
} elseif (isset($_REQUEST['post_id'])) {
|
264 |
+
return (int)$_REQUEST['post_id'];
|
265 |
+
}
|
266 |
+
}
|
267 |
}
|
includes/filters.php
CHANGED
@@ -21,11 +21,21 @@ $cme_extensions = new CME_Extensions();
|
|
21 |
|
22 |
add_filter( 'map_meta_cap', '_cme_remap_term_meta_cap', 5, 4 );
|
23 |
|
|
|
|
|
24 |
if ( defined( 'WC_PLUGIN_FILE' ) ) {
|
25 |
require_once ( dirname(__FILE__) . '/filters-woocommerce.php' );
|
26 |
$cme_extensions->add( new CME_WooCommerce() );
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
if ( is_admin() ) {
|
30 |
global $pagenow;
|
31 |
if ( 'edit.php' == $pagenow ) {
|
@@ -36,6 +46,70 @@ if ( is_admin() ) {
|
|
36 |
|
37 |
add_filter('plugin_action_links_' . plugin_basename(CME_FILE), '_cme_fltPluginActionLinks', 10, 2);
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
// allow edit_terms, delete_terms, assign_terms capabilities to function separately from manage_terms
|
40 |
function _cme_remap_term_meta_cap ( $caps, $cap, $user_id, $args ) {
|
41 |
global $current_user, $cme_cap_helper;
|
@@ -59,6 +133,31 @@ function _cme_remap_term_meta_cap ( $caps, $cap, $user_id, $args ) {
|
|
59 |
|
60 |
// meta caps
|
61 |
switch ( $cap ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
case 'edit_term':
|
63 |
case 'delete_term':
|
64 |
case 'assign_term':
|
21 |
|
22 |
add_filter( 'map_meta_cap', '_cme_remap_term_meta_cap', 5, 4 );
|
23 |
|
24 |
+
add_action( 'admin_head', '_cme_publishpress_roles_js');
|
25 |
+
|
26 |
if ( defined( 'WC_PLUGIN_FILE' ) ) {
|
27 |
require_once ( dirname(__FILE__) . '/filters-woocommerce.php' );
|
28 |
$cme_extensions->add( new CME_WooCommerce() );
|
29 |
}
|
30 |
|
31 |
+
if (!defined('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND')) {
|
32 |
+
global $wp_version;
|
33 |
+
if (version_compare($wp_version, '4.9.7', '>=')) { // avoid any issues with old REST API implementations
|
34 |
+
require_once (dirname(__FILE__) . '/filters-wp_rest_workarounds.php');
|
35 |
+
new PublishPress\Capabilities\WP_REST_Workarounds();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
if ( is_admin() ) {
|
40 |
global $pagenow;
|
41 |
if ( 'edit.php' == $pagenow ) {
|
46 |
|
47 |
add_filter('plugin_action_links_' . plugin_basename(CME_FILE), '_cme_fltPluginActionLinks', 10, 2);
|
48 |
|
49 |
+
|
50 |
+
add_filter('pp_custom_status_list', 'cme_filter_custom_status_list', 10, 2);
|
51 |
+
|
52 |
+
function _cme_publishpress_roles_js() {
|
53 |
+
if (defined('PUBLISHPRESS_VERSION') && ((strpos($_SERVER['REQUEST_URI'], 'page=pp-manage-roles')))) {
|
54 |
+
require_once(dirname(__FILE__) . '/publishpress-roles.php');
|
55 |
+
CME_PublishPressRoles::scripts(); // @todo: .js
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Filters the list of custom statuses
|
61 |
+
*
|
62 |
+
* @param array $custom_statuses
|
63 |
+
* @param WP_Post $post
|
64 |
+
*
|
65 |
+
* @return array
|
66 |
+
*/
|
67 |
+
function cme_filter_custom_status_list($custom_statuses, $post)
|
68 |
+
{
|
69 |
+
if (!get_option('cme_custom_status_control')) {
|
70 |
+
return $custom_statuses;
|
71 |
+
}
|
72 |
+
|
73 |
+
if (class_exists('publishpress') && method_exists('publishpress', 'instance')) {
|
74 |
+
$publishpress = publishpress::instance();
|
75 |
+
} else {
|
76 |
+
global $publishpress;
|
77 |
+
}
|
78 |
+
|
79 |
+
if (empty($publishpress)) {
|
80 |
+
return $custom_statuses;
|
81 |
+
}
|
82 |
+
|
83 |
+
$filtered = [];
|
84 |
+
$option_group = 'global';
|
85 |
+
|
86 |
+
$default_status = $publishpress->custom_status->module->options->default_status;
|
87 |
+
|
88 |
+
if ( ! is_null($post)) {
|
89 |
+
// Adding a new post? Set the correct default status
|
90 |
+
if ('auto-draft' === $post->post_status) {
|
91 |
+
$post->post_status = $default_status;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
foreach ($custom_statuses as &$status) {
|
96 |
+
$slug = str_replace('-', '_', $status->slug);
|
97 |
+
|
98 |
+
// Check if the user, or any of his user groups are capable to use the status. If not, but it is the
|
99 |
+
// current status, we still display it.
|
100 |
+
if (
|
101 |
+
current_user_can('status_change_' . $slug)
|
102 |
+
|| (is_null($post) ? false : $status->slug === $post->post_status)
|
103 |
+
|| $status->slug === $default_status
|
104 |
+
) {
|
105 |
+
$filtered[] = $status;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
return $filtered;
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
// allow edit_terms, delete_terms, assign_terms capabilities to function separately from manage_terms
|
114 |
function _cme_remap_term_meta_cap ( $caps, $cap, $user_id, $args ) {
|
115 |
global $current_user, $cme_cap_helper;
|
133 |
|
134 |
// meta caps
|
135 |
switch ( $cap ) {
|
136 |
+
// If detailed taxonomy capabilities are enabled for categories or tags, don't also require default capability for term assignment / deletion
|
137 |
+
case 'assign_categories':
|
138 |
+
if (in_array('category', $enabled_taxonomies)) {
|
139 |
+
$caps = array_diff($caps, ['edit_posts']);
|
140 |
+
}
|
141 |
+
break;
|
142 |
+
|
143 |
+
case 'assign_post_tags':
|
144 |
+
if (in_array('post_tag', $enabled_taxonomies)) {
|
145 |
+
$caps = array_diff($caps, ['edit_posts']);
|
146 |
+
}
|
147 |
+
break;
|
148 |
+
|
149 |
+
case 'delete_categories':
|
150 |
+
if (in_array('category', $enabled_taxonomies)) {
|
151 |
+
$caps = array_diff($caps, ['manage_categories']);
|
152 |
+
}
|
153 |
+
break;
|
154 |
+
|
155 |
+
case 'delete_post_tags':
|
156 |
+
if (in_array('post_tag', $enabled_taxonomies)) {
|
157 |
+
$caps = array_diff($caps, ['manage_categories']);
|
158 |
+
}
|
159 |
+
break;
|
160 |
+
|
161 |
case 'edit_term':
|
162 |
case 'delete_term':
|
163 |
case 'assign_term':
|
includes/functions-admin.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// perf enhancement: display submenu links without loading framework and plugin code
|
4 |
+
function cme_submenus() {
|
5 |
+
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
|
6 |
+
|
7 |
+
$permissions_title = __('Capabilities', 'capsman-enhanced');
|
8 |
+
|
9 |
+
$menu_order = 72;
|
10 |
+
|
11 |
+
if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
|
12 |
+
foreach (get_option('active_plugins') as $plugin_file) {
|
13 |
+
if ( false !== strpos($plugin_file, 'publishpress.php') ) {
|
14 |
+
$menu_order = 27;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
add_menu_page(
|
20 |
+
$permissions_title,
|
21 |
+
$permissions_title,
|
22 |
+
$cap_name,
|
23 |
+
'capsman',
|
24 |
+
'cme_fakefunc',
|
25 |
+
'dashicons-admin-network',
|
26 |
+
$menu_order
|
27 |
+
);
|
28 |
+
|
29 |
+
add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'capsman' . '-tool', 'cme_fakefunc');
|
30 |
+
}
|
includes/functions.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function _cme_act_pp_active() {
|
3 |
+
if ( defined('PRESSPERMIT_VERSION') || ( defined('PPC_VERSION') && function_exists( 'pp_init_cap_caster' ) ) ) {
|
4 |
+
define( 'PRESSPERMIT_ACTIVE', true );
|
5 |
+
} else {
|
6 |
+
if ( defined('SCOPER_VERSION') || ( defined('PP_VERSION') && function_exists('pp_init_users_interceptor') ) ) {
|
7 |
+
define( 'OLD_PRESSPERMIT_ACTIVE', true );
|
8 |
+
}
|
9 |
+
}
|
10 |
+
}
|
11 |
+
|
12 |
+
function _cme_cap_helper() {
|
13 |
+
global $cme_cap_helper;
|
14 |
+
|
15 |
+
require_once ( dirname(__FILE__) . '/cap-helper.php' );
|
16 |
+
$cme_cap_helper = new CME_Cap_Helper();
|
17 |
+
|
18 |
+
add_action( 'registered_post_type', '_cme_post_type_late_reg', 5, 2 );
|
19 |
+
add_action( 'registered_taxonomy', '_cme_taxonomy_late_reg', 5, 2 );
|
20 |
+
}
|
21 |
+
|
22 |
+
function _cme_post_type_late_reg( $post_type, $type_obj ) {
|
23 |
+
global $cme_cap_helper;
|
24 |
+
|
25 |
+
if ( ! empty( $type_obj->public ) || ! empty( $type_obj->show_ui ) ) {
|
26 |
+
$cme_cap_helper->refresh();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
function _cme_taxonomy_late_reg( $taxonomy, $tx_obj ) {
|
31 |
+
global $cme_cap_helper;
|
32 |
+
|
33 |
+
if ( ! empty( $tx_obj->public ) ) {
|
34 |
+
$cme_cap_helper->refresh();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
function _cme_init() {
|
39 |
+
require_once ( dirname(__FILE__) . '/filters.php' );
|
40 |
+
|
41 |
+
load_plugin_textdomain('capsman-enhanced', false, dirname(__FILE__) . '/lang');
|
42 |
+
}
|
43 |
+
|
44 |
+
function cme_is_plugin_active($check_plugin_file) {
|
45 |
+
if ( ! $check_plugin_file )
|
46 |
+
return false;
|
47 |
+
|
48 |
+
$plugins = get_option('active_plugins');
|
49 |
+
|
50 |
+
foreach ( $plugins as $plugin_file ) {
|
51 |
+
if ( false !== strpos($plugin_file, $check_plugin_file) )
|
52 |
+
return $plugin_file;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
// if a role is marked as hidden, also default it for use by Press Permit as a Pattern Role (when PP Collaborative Editing is activated and Advanced Settings enabled)
|
57 |
+
function _cme_pp_default_pattern_role( $role ) {
|
58 |
+
if ( ! $pp_role_usage = get_option( 'pp_role_usage' ) )
|
59 |
+
$pp_role_usage = array();
|
60 |
+
|
61 |
+
if ( empty( $pp_role_usage[$role] ) ) {
|
62 |
+
$pp_role_usage[$role] = 'pattern';
|
63 |
+
update_option( 'pp_role_usage', $pp_role_usage );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
// deprecated
|
68 |
+
function capsman_get_pp_option( $option_basename ) {
|
69 |
+
return pp_capabilities_get_permissions_option($option_basename);
|
70 |
+
}
|
71 |
+
|
72 |
+
function pp_capabilities_get_permissions_option($option_basename) {
|
73 |
+
return (function_exists('presspermit')) ? presspermit()->getOption($option_basename) : pp_get_option($option_basename);
|
74 |
+
}
|
75 |
+
|
76 |
+
function pp_capabilities_update_permissions_option($option_basename, $option_val) {
|
77 |
+
function_exists('presspermit') ? presspermit()->updateOption($option_basename, $option_val) : pp_update_option($option_basename, $option_val);
|
78 |
+
}
|
includes/handler.php
CHANGED
@@ -10,6 +10,8 @@ class CapsmanHandler
|
|
10 |
function processAdminGeneral( $post ) {
|
11 |
global $wp_roles;
|
12 |
|
|
|
|
|
13 |
// Create a new role.
|
14 |
if ( ! empty($post['CreateRole']) ) {
|
15 |
if ( $newrole = $this->createRole($post['create-name']) ) {
|
@@ -69,8 +71,7 @@ class CapsmanHandler
|
|
69 |
|
70 |
if ( $newname = $this->createNewName($post['capability-name']) ) {
|
71 |
$role->add_cap($newname['name']);
|
72 |
-
|
73 |
-
|
74 |
// for bbPress < 2.2, need to log customization of roles following bbPress activation
|
75 |
$plugins = ( function_exists( 'bbp_get_version' ) && version_compare( bbp_get_version(), '2.2', '<' ) ) ? array( 'bbpress.php' ) : array(); // back compat
|
76 |
|
@@ -82,10 +83,14 @@ class CapsmanHandler
|
|
82 |
|
83 |
global $wpdb;
|
84 |
$wpdb->query( "UPDATE $wpdb->options SET autoload = 'no' WHERE option_name = 'pp_customized_roles'" );
|
|
|
|
|
|
|
|
|
85 |
} else {
|
86 |
-
|
87 |
}
|
88 |
-
|
89 |
} elseif ( ! empty($post['update_filtered_types']) || ! empty($post['update_filtered_taxonomies']) || ! empty($post['update_detailed_taxonomies']) ) {
|
90 |
//if ( /* settings saved successfully on plugins_loaded action */ ) {
|
91 |
ak_admin_notify(__('Type / Taxonomy settings saved.', 'capsman-enhanced'));
|
@@ -93,15 +98,18 @@ class CapsmanHandler
|
|
93 |
// ak_admin_error(__('Error saving capability settings.', 'capsman-enhanced'));
|
94 |
//}
|
95 |
} else {
|
96 |
-
|
97 |
-
|
|
|
98 |
}
|
99 |
|
100 |
if ( ! empty($newrole) && defined('PRESSPERMIT_ACTIVE') ) {
|
101 |
if ( ( ! empty($post['CreateRole']) && ! empty( $_REQUEST['new_role_pp_only'] ) ) || ( ! empty($post['CopyRole']) && ! empty( $_REQUEST['copy_role_pp_only'] ) ) ) {
|
102 |
-
$pp_only = (array)
|
103 |
$pp_only[]= $newrole;
|
104 |
-
|
|
|
|
|
105 |
_cme_pp_default_pattern_role( $newrole );
|
106 |
pp_refresh_options();
|
107 |
}
|
10 |
function processAdminGeneral( $post ) {
|
11 |
global $wp_roles;
|
12 |
|
13 |
+
do_action('publishpress-caps_process_update');
|
14 |
+
|
15 |
// Create a new role.
|
16 |
if ( ! empty($post['CreateRole']) ) {
|
17 |
if ( $newrole = $this->createRole($post['create-name']) ) {
|
71 |
|
72 |
if ( $newname = $this->createNewName($post['capability-name']) ) {
|
73 |
$role->add_cap($newname['name']);
|
74 |
+
|
|
|
75 |
// for bbPress < 2.2, need to log customization of roles following bbPress activation
|
76 |
$plugins = ( function_exists( 'bbp_get_version' ) && version_compare( bbp_get_version(), '2.2', '<' ) ) ? array( 'bbpress.php' ) : array(); // back compat
|
77 |
|
83 |
|
84 |
global $wpdb;
|
85 |
$wpdb->query( "UPDATE $wpdb->options SET autoload = 'no' WHERE option_name = 'pp_customized_roles'" );
|
86 |
+
|
87 |
+
$url = admin_url('admin.php?page=capsman&role=' . $post['role'] . '&added=1');
|
88 |
+
wp_redirect($url);
|
89 |
+
exit;
|
90 |
} else {
|
91 |
+
ak_admin_notify(__('Incorrect capability name.'));
|
92 |
}
|
93 |
+
|
94 |
} elseif ( ! empty($post['update_filtered_types']) || ! empty($post['update_filtered_taxonomies']) || ! empty($post['update_detailed_taxonomies']) ) {
|
95 |
//if ( /* settings saved successfully on plugins_loaded action */ ) {
|
96 |
ak_admin_notify(__('Type / Taxonomy settings saved.', 'capsman-enhanced'));
|
98 |
// ak_admin_error(__('Error saving capability settings.', 'capsman-enhanced'));
|
99 |
//}
|
100 |
} else {
|
101 |
+
if (!apply_filters('publishpress-caps_submission_ok', false)) {
|
102 |
+
ak_admin_error(__('Bad form received.', 'capsman-enhanced'));
|
103 |
+
}
|
104 |
}
|
105 |
|
106 |
if ( ! empty($newrole) && defined('PRESSPERMIT_ACTIVE') ) {
|
107 |
if ( ( ! empty($post['CreateRole']) && ! empty( $_REQUEST['new_role_pp_only'] ) ) || ( ! empty($post['CopyRole']) && ! empty( $_REQUEST['copy_role_pp_only'] ) ) ) {
|
108 |
+
$pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
|
109 |
$pp_only[]= $newrole;
|
110 |
+
|
111 |
+
pp_capabilities_update_permissions_option('supplemental_role_defs', $pp_only);
|
112 |
+
|
113 |
_cme_pp_default_pattern_role( $newrole );
|
114 |
pp_refresh_options();
|
115 |
}
|
includes/manager.php
CHANGED
@@ -4,25 +4,26 @@
|
|
4 |
* Plugin to create and manage roles and capabilities.
|
5 |
*
|
6 |
* @author Jordi Canals, Kevin Behrens
|
7 |
-
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C)
|
8 |
* @license GNU General Public License version 2
|
9 |
-
* @link https://publishpress.com
|
10 |
*
|
11 |
-
|
12 |
-
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
26 |
*/
|
27 |
|
28 |
add_action( 'init', 'cme_update_pp_usage' ); // update early so resulting post type cap changes are applied for this request's UI construction
|
@@ -79,7 +80,7 @@ function _cme_is_read_removal_blocked( $role_name ) {
|
|
79 |
* Sets the main environment for all Capability Manager components.
|
80 |
*
|
81 |
* @author Jordi Canals, Kevin Behrens
|
82 |
-
* @link https://publishpress.com
|
83 |
*/
|
84 |
class CapabilityManager
|
85 |
{
|
@@ -149,17 +150,17 @@ class CapabilityManager
|
|
149 |
if ( empty( $_REQUEST['page'] ) || ! in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) ) )
|
150 |
return;
|
151 |
|
152 |
-
wp_enqueue_style('
|
153 |
|
154 |
-
wp_register_style( $this->ID . 'framework_admin', $this->mod_url . '/framework/styles/admin.css', false,
|
155 |
wp_enqueue_style( $this->ID . 'framework_admin');
|
156 |
|
157 |
-
wp_register_style( $this->ID . '_admin', $this->mod_url . '/admin.css', false,
|
158 |
wp_enqueue_style( $this->ID . '_admin');
|
159 |
|
160 |
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
161 |
$url = $this->mod_url . "/admin{$suffix}.js";
|
162 |
-
wp_enqueue_script( 'cme_admin', $url, array('jquery'),
|
163 |
wp_localize_script( 'cme_admin', 'cmeAdmin', array(
|
164 |
'negationCaption' => __( 'Explicity negate this capability by storing as disabled', 'capsman-enhanced' ),
|
165 |
'typeCapsNegationCaption' => __( 'Explicitly negate these capabilities by storing as disabled', 'capsman-enhanced' ),
|
@@ -184,8 +185,8 @@ class CapabilityManager
|
|
184 |
protected function moduleLoad ()
|
185 |
{
|
186 |
$old_version = get_option($this->ID . '_version');
|
187 |
-
if ( version_compare( $old_version,
|
188 |
-
update_option($this->ID . '_version',
|
189 |
$this->pluginUpdate();
|
190 |
}
|
191 |
|
@@ -264,25 +265,35 @@ class CapabilityManager
|
|
264 |
$this->setAdminCapability();
|
265 |
}
|
266 |
|
267 |
-
add_action( 'admin_menu', array( &$this, 'cme_menu' ),
|
268 |
}
|
269 |
|
270 |
public function cme_menu() {
|
271 |
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
|
272 |
-
add_management_page(__('Capability Manager', 'capsman-enhanced'), __('Capability Manager', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
|
273 |
-
|
274 |
-
if ( did_action( 'pp_admin_menu' ) ) { // Put Capabilities link on Permissions menu if Press Permit is active and user has access to it
|
275 |
-
global $pp_admin;
|
276 |
-
$menu_caption = ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
|
277 |
-
add_submenu_page( $pp_admin->get_menu('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', $this->ID, array($this, 'generalManager') );
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
}
|
287 |
|
288 |
/**
|
@@ -429,6 +440,10 @@ class CapabilityManager
|
|
429 |
} elseif ( ! empty($_REQUEST['AddCap']) ) {
|
430 |
ak_admin_notify( $this->message );
|
431 |
}
|
|
|
|
|
|
|
|
|
432 |
}
|
433 |
|
434 |
$this->generateNames();
|
@@ -441,7 +456,13 @@ class CapabilityManager
|
|
441 |
}
|
442 |
|
443 |
if ( ! isset($this->current) ) { // By default, we manage the default role
|
444 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
}
|
446 |
|
447 |
if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
|
@@ -598,3 +619,45 @@ class CapabilityManager
|
|
598 |
include ( dirname(CME_FILE) . '/includes/backup.php' );
|
599 |
}
|
600 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
* Plugin to create and manage roles and capabilities.
|
5 |
*
|
6 |
* @author Jordi Canals, Kevin Behrens
|
7 |
+
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
|
8 |
* @license GNU General Public License version 2
|
9 |
+
* @link https://publishpress.com/
|
10 |
*
|
11 |
+
*
|
12 |
+
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
+
*
|
14 |
+
* Modifications Copyright 2020, PublishPress <help@publishpress.com>
|
15 |
+
*
|
16 |
+
* This program is free software; you can redistribute it and/or
|
17 |
+
* modify it under the terms of the GNU General Public License
|
18 |
+
* version 2 as published by the Free Software Foundation.
|
19 |
+
*
|
20 |
+
* This program is distributed in the hope that it will be useful,
|
21 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
* GNU General Public License for more details.
|
24 |
+
*
|
25 |
+
* You should have received a copy of the GNU General Public License
|
26 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27 |
*/
|
28 |
|
29 |
add_action( 'init', 'cme_update_pp_usage' ); // update early so resulting post type cap changes are applied for this request's UI construction
|
80 |
* Sets the main environment for all Capability Manager components.
|
81 |
*
|
82 |
* @author Jordi Canals, Kevin Behrens
|
83 |
+
* @link https://publishpress.com/
|
84 |
*/
|
85 |
class CapabilityManager
|
86 |
{
|
150 |
if ( empty( $_REQUEST['page'] ) || ! in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) ) )
|
151 |
return;
|
152 |
|
153 |
+
wp_enqueue_style('cme-admin-common', $this->mod_url . '/common/css/pressshack-admin.css', [], PUBLISHPRESS_CAPS_VERSION);
|
154 |
|
155 |
+
wp_register_style( $this->ID . 'framework_admin', $this->mod_url . '/framework/styles/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
|
156 |
wp_enqueue_style( $this->ID . 'framework_admin');
|
157 |
|
158 |
+
wp_register_style( $this->ID . '_admin', $this->mod_url . '/admin.css', false, PUBLISHPRESS_CAPS_VERSION);
|
159 |
wp_enqueue_style( $this->ID . '_admin');
|
160 |
|
161 |
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
162 |
$url = $this->mod_url . "/admin{$suffix}.js";
|
163 |
+
wp_enqueue_script( 'cme_admin', $url, array('jquery'), PUBLISHPRESS_CAPS_VERSION, true );
|
164 |
wp_localize_script( 'cme_admin', 'cmeAdmin', array(
|
165 |
'negationCaption' => __( 'Explicity negate this capability by storing as disabled', 'capsman-enhanced' ),
|
166 |
'typeCapsNegationCaption' => __( 'Explicitly negate these capabilities by storing as disabled', 'capsman-enhanced' ),
|
185 |
protected function moduleLoad ()
|
186 |
{
|
187 |
$old_version = get_option($this->ID . '_version');
|
188 |
+
if ( version_compare( $old_version, PUBLISHPRESS_CAPS_VERSION, 'ne') ) {
|
189 |
+
update_option($this->ID . '_version', PUBLISHPRESS_CAPS_VERSION);
|
190 |
$this->pluginUpdate();
|
191 |
}
|
192 |
|
265 |
$this->setAdminCapability();
|
266 |
}
|
267 |
|
268 |
+
add_action( 'admin_menu', array( &$this, 'cme_menu' ), 18 );
|
269 |
}
|
270 |
|
271 |
public function cme_menu() {
|
272 |
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
+
$permissions_title = __('Capabilities', 'capsman-enhanced');
|
275 |
+
|
276 |
+
$menu_order = 72;
|
277 |
+
|
278 |
+
if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
|
279 |
+
foreach (get_option('active_plugins') as $plugin_file) {
|
280 |
+
if ( false !== strpos($plugin_file, 'publishpress.php') ) {
|
281 |
+
$menu_order = 27;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
add_menu_page(
|
287 |
+
$permissions_title,
|
288 |
+
$permissions_title,
|
289 |
+
$cap_name,
|
290 |
+
'capsman',
|
291 |
+
array($this, 'generalManager'),
|
292 |
+
'dashicons-admin-network',
|
293 |
+
$menu_order
|
294 |
+
);
|
295 |
+
|
296 |
+
add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
|
297 |
}
|
298 |
|
299 |
/**
|
440 |
} elseif ( ! empty($_REQUEST['AddCap']) ) {
|
441 |
ak_admin_notify( $this->message );
|
442 |
}
|
443 |
+
} else {
|
444 |
+
if (!empty($_REQUEST['added'])) {
|
445 |
+
ak_admin_notify(__('New capability added to role.'));
|
446 |
+
}
|
447 |
}
|
448 |
|
449 |
$this->generateNames();
|
456 |
}
|
457 |
|
458 |
if ( ! isset($this->current) ) { // By default, we manage the default role
|
459 |
+
if (empty($_POST) && !empty($_REQUEST['role'])) {
|
460 |
+
$this->current = $_REQUEST['role'];
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
if (!isset($this->current) || !get_role($this->current)) {
|
465 |
+
$this->current = get_option('default_role');
|
466 |
}
|
467 |
|
468 |
if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
|
619 |
include ( dirname(CME_FILE) . '/includes/backup.php' );
|
620 |
}
|
621 |
}
|
622 |
+
|
623 |
+
function cme_publishpressFooter() {
|
624 |
+
?>
|
625 |
+
<footer>
|
626 |
+
|
627 |
+
<div class="pp-rating">
|
628 |
+
<a href="https://wordpress.org/support/plugin/capability-manager-enhanced/reviews/#new-post" target="_blank" rel="noopener noreferrer">
|
629 |
+
<?php printf(
|
630 |
+
__('If you like %s, please leave us a %s rating. Thank you!', 'capsman-enhanced'),
|
631 |
+
'<strong>PublishPress Capabilities</strong>',
|
632 |
+
'<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>'
|
633 |
+
);
|
634 |
+
?>
|
635 |
+
</a>
|
636 |
+
</div>
|
637 |
+
|
638 |
+
<hr>
|
639 |
+
<nav>
|
640 |
+
<ul>
|
641 |
+
<li><a href="https://publishpress.com/capability-manager/" target="_blank" rel="noopener noreferrer" title="<?php _e('About PublishPress Capabilities', 'capsman-enhanced');?>"><?php _e('About', 'capsman-enhanced');?>
|
642 |
+
</a></li>
|
643 |
+
<li><a href="https://publishpress.com/knowledge-base/how-to-use-capability-manager/" target="_blank" rel="noopener noreferrer" title="<?php _e('Capabilites Documentation', 'capsman-enhanced');?>"><?php _e('Documentation', 'capsman-enhanced');?>
|
644 |
+
</a></li>
|
645 |
+
<li><a href="https://publishpress.com/contact" target="_blank" rel="noopener noreferrer" title="<?php _e('Contact the PublishPress team', 'capsman-enhanced');?>"><?php _e('Contact', 'capsman-enhanced');?>
|
646 |
+
</a></li>
|
647 |
+
<li><a href="https://twitter.com/publishpresscom" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-twitter"></span>
|
648 |
+
</a></li>
|
649 |
+
<li><a href="https://facebook.com/publishpress" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-facebook"></span>
|
650 |
+
</a></li>
|
651 |
+
</ul>
|
652 |
+
</nav>
|
653 |
+
|
654 |
+
<div class="pp-pressshack-logo">
|
655 |
+
<a href="https://publishpress.com" target="_blank" rel="noopener noreferrer">
|
656 |
+
|
657 |
+
<img src="<?php echo plugins_url('', CME_FILE) . '/common/img/publishpress-logo.png';?>" />
|
658 |
+
</a>
|
659 |
+
</div>
|
660 |
+
|
661 |
+
</footer>
|
662 |
+
<?php
|
663 |
+
}
|
includes/network.php
CHANGED
@@ -16,7 +16,7 @@ function _cme_new_blog( $new_blog_id ) {
|
|
16 |
$main_admin_caps = $admin_role->capabilities;
|
17 |
|
18 |
if ( defined('PRESSPERMIT_ACTIVE') )
|
19 |
-
$main_pp_only = (array)
|
20 |
//$pp_only[]= $newrole;
|
21 |
|
22 |
foreach( $autocreate_roles as $role_name ) {
|
@@ -31,7 +31,7 @@ function _cme_new_blog( $new_blog_id ) {
|
|
31 |
|
32 |
if ( defined('PRESSPERMIT_ACTIVE') ) {
|
33 |
pp_refresh_options();
|
34 |
-
$blog_pp_only = (array)
|
35 |
}
|
36 |
|
37 |
foreach( $main_site_caps as $role_name => $caps ) {
|
@@ -62,8 +62,9 @@ function _cme_new_blog( $new_blog_id ) {
|
|
62 |
}
|
63 |
}
|
64 |
|
65 |
-
if ( defined('PRESSPERMIT_ACTIVE') )
|
66 |
-
|
|
|
67 |
|
68 |
restore_current_blog();
|
69 |
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
16 |
$main_admin_caps = $admin_role->capabilities;
|
17 |
|
18 |
if ( defined('PRESSPERMIT_ACTIVE') )
|
19 |
+
$main_pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
|
20 |
//$pp_only[]= $newrole;
|
21 |
|
22 |
foreach( $autocreate_roles as $role_name ) {
|
31 |
|
32 |
if ( defined('PRESSPERMIT_ACTIVE') ) {
|
33 |
pp_refresh_options();
|
34 |
+
$blog_pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
|
35 |
}
|
36 |
|
37 |
foreach( $main_site_caps as $role_name => $caps ) {
|
62 |
}
|
63 |
}
|
64 |
|
65 |
+
if ( defined('PRESSPERMIT_ACTIVE') ) {
|
66 |
+
pp_capabilities_update_permissions_option('supplemental_role_defs', $blog_pp_only);
|
67 |
+
}
|
68 |
|
69 |
restore_current_blog();
|
70 |
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
includes/pp-handler.php
CHANGED
@@ -53,6 +53,10 @@ function _cme_update_pp_usage() {
|
|
53 |
update_option( 'cme_enabled_post_types', $value );
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
56 |
$updated = true;
|
57 |
}
|
58 |
|
@@ -64,14 +68,15 @@ function _cme_update_pp_usage() {
|
|
64 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
65 |
if ( ! empty( $_REQUEST['SaveRole']) ) {
|
66 |
if ( ! empty( $_REQUEST['role'] ) ) {
|
67 |
-
$pp_only = (array)
|
68 |
|
69 |
if ( empty($_REQUEST['pp_only_role']) )
|
70 |
$pp_only = array_diff( $pp_only, array($_REQUEST['role']) );
|
71 |
else
|
72 |
$pp_only[]= $_REQUEST['role'];
|
73 |
|
74 |
-
|
|
|
75 |
_cme_pp_default_pattern_role( $_REQUEST['role'] );
|
76 |
}
|
77 |
}
|
53 |
update_option( 'cme_enabled_post_types', $value );
|
54 |
}
|
55 |
|
56 |
+
if (defined('PRESSPERMIT_ACTIVE') && in_array($option_basename, ['enabled_post_types', 'enabled_taxonomies'])) {
|
57 |
+
pp_capabilities_update_permissions_option($option_basename, $value);
|
58 |
+
}
|
59 |
+
|
60 |
$updated = true;
|
61 |
}
|
62 |
|
68 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
69 |
if ( ! empty( $_REQUEST['SaveRole']) ) {
|
70 |
if ( ! empty( $_REQUEST['role'] ) ) {
|
71 |
+
$pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
|
72 |
|
73 |
if ( empty($_REQUEST['pp_only_role']) )
|
74 |
$pp_only = array_diff( $pp_only, array($_REQUEST['role']) );
|
75 |
else
|
76 |
$pp_only[]= $_REQUEST['role'];
|
77 |
|
78 |
+
pp_capabilities_update_permissions_option('supplemental_role_defs', array_unique($pp_only));
|
79 |
+
|
80 |
_cme_pp_default_pattern_role( $_REQUEST['role'] );
|
81 |
}
|
82 |
}
|
includes/pp-ui.php
CHANGED
@@ -30,17 +30,17 @@ class Capsman_PP_UI {
|
|
30 |
}
|
31 |
|
32 |
function show_capability_hints( $default ) {
|
33 |
-
if (
|
34 |
$cme_id = 'capsman';
|
35 |
|
36 |
-
echo '<ul class="ul-disc" style="margin-top:10px">';
|
37 |
|
38 |
$pp_prefix = ( defined( 'PRESSPERMIT_VERSION') ) ? 'presspermit' : 'pp';
|
39 |
|
40 |
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PRESSPERMIT_ACTIVE' ) || in_array( $default, array( 'subscriber', 'contributor', 'author', 'editor' ) ) ) {
|
41 |
echo '<li>';
|
42 |
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
43 |
-
if (
|
44 |
$parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'capsman-enhanced' ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-role-usage") . "'>", '</a>' ) . ')';
|
45 |
else
|
46 |
$parenthetical = ' (' . sprintf( __( 'activate %1$sAdvanced settings%2$s, see Role Usage', 'capsman-enhanced' ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-settings&pp_tab=advanced") . "'>", '</a>' ). ')';
|
@@ -48,7 +48,7 @@ class Capsman_PP_UI {
|
|
48 |
$parenthetical = '';
|
49 |
|
50 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) )
|
51 |
-
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical )
|
52 |
else
|
53 |
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
|
54 |
|
@@ -59,7 +59,7 @@ class Capsman_PP_UI {
|
|
59 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) )
|
60 |
if ( defined( 'PPS_VERSION' ) )
|
61 |
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. (See %sPermissions > Post Statuses%s for applicable names). %sSupplemental status-specific roles%s are usually more convenient, though.', $cme_id ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-statuses&show_caps=1") . "'>", '</a>', "<a href='" . admin_url("admin.php?page={$pp_prefix}-groups") . "'>", '</a>' ) ;
|
62 |
-
elseif (
|
63 |
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles.', $cme_id ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-role-usage") . "'>", '</a>' ) ;
|
64 |
|
65 |
elseif ( defined( 'PP_VERSION' ) )
|
@@ -80,7 +80,7 @@ class Capsman_PP_UI {
|
|
80 |
<div style="float:right">
|
81 |
<?php
|
82 |
pp_refresh_options();
|
83 |
-
$pp_only = (array)
|
84 |
$checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
|
85 |
?>
|
86 |
<label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
|
@@ -100,7 +100,7 @@ class Capsman_PP_UI {
|
|
100 |
$caption = __( 'Ensure permissions can be controlled separately from other post types.', 'capsman-enhanced' );
|
101 |
echo "<p class='cme-hint'>$caption</p>";
|
102 |
|
103 |
-
if ( defined( 'PRESSPERMIT_ACTIVE' ) &&
|
104 |
<div class="cme-subtext" style="margin-top:0">
|
105 |
<?php /*_e( '(PP Filtered Post Types, Taxonomies)', 'capsman-enhanced' ); */?>
|
106 |
</div>
|
30 |
}
|
31 |
|
32 |
function show_capability_hints( $default ) {
|
33 |
+
if ( pp_capabilities_get_permissions_option('display_hints') ) {
|
34 |
$cme_id = 'capsman';
|
35 |
|
36 |
+
echo '<ul class="ul-disc publishpress-caps-extra-hints" style="margin-top:10px;display:none">';
|
37 |
|
38 |
$pp_prefix = ( defined( 'PRESSPERMIT_VERSION') ) ? 'presspermit' : 'pp';
|
39 |
|
40 |
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PRESSPERMIT_ACTIVE' ) || in_array( $default, array( 'subscriber', 'contributor', 'author', 'editor' ) ) ) {
|
41 |
echo '<li>';
|
42 |
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
43 |
+
if ( pp_capabilities_get_permissions_option( 'advanced_options' ) )
|
44 |
$parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'capsman-enhanced' ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-role-usage") . "'>", '</a>' ) . ')';
|
45 |
else
|
46 |
$parenthetical = ' (' . sprintf( __( 'activate %1$sAdvanced settings%2$s, see Role Usage', 'capsman-enhanced' ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-settings&pp_tab=advanced") . "'>", '</a>' ). ')';
|
48 |
$parenthetical = '';
|
49 |
|
50 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) )
|
51 |
+
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical );
|
52 |
else
|
53 |
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
|
54 |
|
59 |
if ( defined( 'PRESSPERMIT_ACTIVE' ) )
|
60 |
if ( defined( 'PPS_VERSION' ) )
|
61 |
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. (See %sPermissions > Post Statuses%s for applicable names). %sSupplemental status-specific roles%s are usually more convenient, though.', $cme_id ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-statuses&show_caps=1") . "'>", '</a>', "<a href='" . admin_url("admin.php?page={$pp_prefix}-groups") . "'>", '</a>' ) ;
|
62 |
+
elseif ( pp_capabilities_get_permissions_option( 'display_extension_hints' ) )
|
63 |
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles.', $cme_id ), "<a href='" . admin_url("admin.php?page={$pp_prefix}-role-usage") . "'>", '</a>' ) ;
|
64 |
|
65 |
elseif ( defined( 'PP_VERSION' ) )
|
80 |
<div style="float:right">
|
81 |
<?php
|
82 |
pp_refresh_options();
|
83 |
+
$pp_only = (array) pp_capabilities_get_permissions_option( 'supplemental_role_defs' );
|
84 |
$checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
|
85 |
?>
|
86 |
<label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
|
100 |
$caption = __( 'Ensure permissions can be controlled separately from other post types.', 'capsman-enhanced' );
|
101 |
echo "<p class='cme-hint'>$caption</p>";
|
102 |
|
103 |
+
if ( defined( 'PRESSPERMIT_ACTIVE' ) && pp_capabilities_get_permissions_option( 'display_hints' ) ) :?>
|
104 |
<div class="cme-subtext" style="margin-top:0">
|
105 |
<?php /*_e( '(PP Filtered Post Types, Taxonomies)', 'capsman-enhanced' ); */?>
|
106 |
</div>
|
includes/publishpress-roles.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class CME_PublishPressRoles {
|
3 |
+
function scripts() {
|
4 |
+
?>
|
5 |
+
<script type="text/javascript">
|
6 |
+
/* <![CDATA[ */
|
7 |
+
jQuery(document).ready(function ($) {
|
8 |
+
$('#the-list').children('tr').each(function(index, e) {
|
9 |
+
if (!$(e).find('td.display_name div.row-actions span.edit-capabilities').count) {
|
10 |
+
var link = '';
|
11 |
+
var is_administrator_role = ('role-administrator' == $(e).attr('id'));
|
12 |
+
var role_name = $(e).attr('id');
|
13 |
+
role_name = role_name.replace('role-', '');
|
14 |
+
|
15 |
+
if (is_administrator_role) {
|
16 |
+
link += ' | ';
|
17 |
+
}
|
18 |
+
|
19 |
+
link += '<a href="<?php echo admin_url('admin.php?page=capsman');?>' + '&role=' + role_name + '">' + 'Capabilities' + '</a> ';
|
20 |
+
|
21 |
+
if (!is_administrator_role) {
|
22 |
+
link += '| ';
|
23 |
+
}
|
24 |
+
|
25 |
+
$(e).find('td.display_name div.row-actions span.edit-role').after(' <span class="edit edit-capabilities">' + link + '</span>');
|
26 |
+
}
|
27 |
+
});
|
28 |
+
});
|
29 |
+
/* ]]> */
|
30 |
+
</script>
|
31 |
+
<style type="text/css">
|
32 |
+
|
33 |
+
</style>
|
34 |
+
<?php
|
35 |
+
}
|
36 |
+
}
|
lang/capsman.mo
CHANGED
Binary file
|
lang/capsman.po
CHANGED
@@ -2,300 +2,281 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Capability Manager Enhanced\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
|
8 |
"Language-Team: PublishPress <help@publishpress.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
|
13 |
-
"X-Poedit-Basepath: F:\\
|
14 |
"X-Poedit-Language: English\n"
|
15 |
"X-Poedit-Country: UNITED STATES\n"
|
16 |
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
-
"X-Poedit-SearchPath-0: F:\\
|
18 |
-
"X-Poedit-SearchPath-1: F:\\
|
19 |
|
20 |
-
#: F:\
|
21 |
-
msgid "<strong>Error:</strong>
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: F:\
|
|
|
|
|
|
|
|
|
25 |
msgid "Warning:"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: F:\
|
29 |
#, php-format
|
30 |
msgid "The active plugin %s is not compatible with your PHP version."
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: F:\
|
34 |
#, php-format
|
35 |
msgid "%s is required for this plugin."
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: F:\
|
39 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:148
|
40 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:152
|
41 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:155
|
42 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:272
|
43 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:277
|
44 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:281
|
45 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:284
|
46 |
-
msgid "Capability Manager"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:147
|
50 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:151
|
51 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:155
|
52 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:276
|
53 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:280
|
54 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/manager.php:284
|
55 |
-
msgid "Capabilities"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/framework/lib/formating.php:40
|
59 |
msgid "Settings saved."
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: F:\
|
63 |
#, php-format
|
64 |
msgid "Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s."
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: F:\
|
68 |
-
msgid "
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: F:\
|
72 |
#, php-format
|
73 |
msgid "Capabilities for %s"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: F:\
|
77 |
-
#: F:\
|
78 |
msgid "Save Changes"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: F:\
|
82 |
msgid "<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation."
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: F:\
|
86 |
#, php-format
|
87 |
-
msgid "
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: F:\
|
91 |
-
|
|
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: F:\
|
95 |
msgid "Automatically define type-specific capabilities for your custom post types and taxonomies"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: F:\
|
99 |
msgid "Assign standard WP roles supplementally for a specific post type"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: F:\
|
103 |
msgid "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: F:\
|
107 |
msgid "Customize reading permissions per-category or per-post"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: F:\
|
111 |
msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: F:\
|
115 |
msgid "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>"
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: F:\
|
119 |
msgid "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: F:\
|
123 |
msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: F:\
|
127 |
msgid "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: F:\
|
131 |
msgid "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: F:\
|
135 |
msgid "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: F:\
|
139 |
msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: F:\
|
143 |
msgid "Member support forum"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: F:\
|
147 |
#, php-format
|
148 |
msgid "%1$sgrab%2$s %3$s"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: F:\
|
152 |
#, php-format
|
153 |
msgid "%s (free install)"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: F:\
|
157 |
#, php-format
|
158 |
msgid "%1$sbuy%2$s %3$s"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: F:\
|
162 |
#, php-format
|
163 |
msgid "%s info/purchase"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: F:\
|
167 |
msgid " "
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: F:\
|
171 |
msgid "Reading"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: F:\
|
175 |
msgid "Editing Capabilities"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: F:\
|
179 |
msgid "Deletion Capabilities"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: F:\
|
183 |
msgid "can read posts which are currently published with private visibility"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: F:\
|
187 |
msgid "has basic editing capability (but may need other capabilities based on post status and ownership)"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: F:\
|
191 |
msgid "can edit posts which were created by other users"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: F:\
|
195 |
msgid "can edit posts which are currently published"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: F:\
|
199 |
msgid "can edit posts which are currently published with private visibility"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: F:\
|
203 |
msgid "can make a post publicly visible"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: F:\
|
207 |
msgid "has basic deletion capability (but may need other capabilities based on post status and ownership)"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: F:\
|
211 |
msgid "can delete posts which were created by other users"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: F:\
|
215 |
msgid "can delete posts which are currently published"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: F:\
|
219 |
msgid "can delete posts which are currently published with private visibility"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: F:\
|
223 |
-
#: F:\
|
224 |
-
#: F:\
|
225 |
-
#: F:\
|
226 |
-
#: F:\
|
227 |
#, php-format
|
228 |
msgid "%s: assigned by Permission Group"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: F:\
|
232 |
#, php-format
|
233 |
msgid "shared capability: %s"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: F:\
|
237 |
msgid "Other WordPress Core Capabilities"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: F:\
|
241 |
msgid "Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add \"dashboard_lockout_ok\" capability"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: F:\
|
245 |
-
#: F:\
|
246 |
-
#: F:\
|
247 |
-
#: F:\
|
248 |
msgid "check/uncheck all"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: F:\
|
252 |
-
#: F:\
|
253 |
-
#: F:\
|
254 |
-
#: F:\
|
255 |
msgid "negate all (storing as disabled capabilities)"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: F:\
|
259 |
-
#: F:\
|
260 |
-
#: F:\
|
261 |
-
#: F:\
|
262 |
msgid "negate none (add/remove all capabilities normally)"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: F:\
|
266 |
#, php-format
|
267 |
msgid "%s Capabilities"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: F:\
|
271 |
msgid "Additional Capabilities"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: F:\
|
275 |
msgid "Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect."
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: F:\
|
279 |
msgid "Invalid Capabilities"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: F:\
|
283 |
msgid "Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities."
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: F:\
|
287 |
msgid "Role Level:"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: F:\
|
291 |
-
msgid "Note: Underscores replace spaces in stored capability name (\"edit users\" => \"edit_users\")."
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1020
|
295 |
msgid "Delete this role"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: F:\
|
299 |
#, php-format
|
300 |
msgid ""
|
301 |
"You are about to delete the %s role.\n"
|
@@ -303,440 +284,427 @@ msgid ""
|
|
303 |
" 'Cancel' to stop, 'OK' to delete."
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: F:\
|
307 |
msgid "Delete Role"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: F:\
|
311 |
msgid "Select New Role"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: F:\
|
315 |
msgid "Change"
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: F:\
|
319 |
msgid "Create New Role"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: F:\
|
323 |
-
#: F:\
|
324 |
msgid "Role Name"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: F:\
|
328 |
-
#: F:\
|
329 |
msgid "Make role available for supplemental assignment to Permission Groups only"
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: F:\
|
333 |
-
#: F:\
|
334 |
msgid "hidden"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: F:\
|
338 |
msgid "Create"
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: F:\
|
342 |
msgid "Copy this role to"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: F:\
|
346 |
msgid "Copy"
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: F:\
|
350 |
msgid "Add Capability"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: F:\
|
354 |
msgid "Add to role"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: F:\
|
358 |
msgid "Backup Tool"
|
359 |
msgstr ""
|
360 |
|
361 |
-
#: F:\
|
362 |
msgid "Backup / Restore Roles"
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: F:\
|
366 |
msgid "Related Permissions Plugins"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: F:\
|
370 |
msgid "Multiple Authors"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: F:\
|
374 |
-
msgid "PressPermit"
|
375 |
-
msgstr ""
|
376 |
-
|
377 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1107
|
378 |
msgid "PublishPress"
|
379 |
msgstr ""
|
380 |
|
381 |
-
#: F:\
|
382 |
msgid "PublishPress Revisions"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: F:\
|
386 |
msgid "Help / Contact Form"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: F:\
|
390 |
msgid "Create this role definition in new (future) sites"
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: F:\
|
394 |
msgid "include in new sites"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: F:\
|
398 |
msgid "Copy / update this role definition to all sites now"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: F:\
|
402 |
msgid "sync role to all sites now"
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: F:\
|
406 |
-
#, php-format
|
407 |
-
msgid "If you like %s, please leave us a %s rating. Thank you!"
|
408 |
-
msgstr ""
|
409 |
-
|
410 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1180
|
411 |
-
msgid "About Capability Manager Enhanced"
|
412 |
-
msgstr ""
|
413 |
-
|
414 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1180
|
415 |
-
msgid "About"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1182
|
419 |
-
msgid "Capability Manager Enhanced Documentation"
|
420 |
-
msgstr ""
|
421 |
-
|
422 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1182
|
423 |
-
msgid "Documentation"
|
424 |
-
msgstr ""
|
425 |
-
|
426 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1184
|
427 |
-
msgid "Contact the PublishPress team"
|
428 |
-
msgstr ""
|
429 |
-
|
430 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/admin.php:1184
|
431 |
-
msgid "Contact"
|
432 |
-
msgstr ""
|
433 |
-
|
434 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:9
|
435 |
msgid "You do not have permission to restore roles."
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: F:\
|
439 |
msgid "New backup saved."
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: F:\
|
443 |
msgid "Roles and Capabilities restored from initial backup."
|
444 |
msgstr ""
|
445 |
|
446 |
-
#: F:\
|
447 |
-
#: F:\
|
448 |
msgid "Restore failed. No backup found."
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: F:\
|
452 |
msgid "Roles and Capabilities restored from last backup."
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: F:\
|
456 |
msgid "Needed function to create default roles not found!"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: F:\
|
460 |
msgid "Roles and Capabilities reset to WordPress defaults"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: F:\
|
464 |
#, php-format
|
465 |
-
msgid "Backup Tool for %1$
|
466 |
msgstr ""
|
467 |
|
468 |
-
#: F:\
|
469 |
msgid "Backup and Restore"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: F:\
|
473 |
msgid "Select action:"
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: F:\
|
477 |
msgid "Backup roles and capabilities"
|
478 |
msgstr ""
|
479 |
|
480 |
-
#: F:\
|
481 |
msgid "Restore initial backup"
|
482 |
msgstr ""
|
483 |
|
484 |
-
#: F:\
|
485 |
msgid "Restore last saved backup"
|
486 |
msgstr ""
|
487 |
|
488 |
-
#: F:\
|
489 |
msgid "Do Action"
|
490 |
msgstr ""
|
491 |
|
492 |
-
#: F:\
|
493 |
msgid "Show initial backup"
|
494 |
msgstr ""
|
495 |
|
496 |
-
#: F:\
|
497 |
msgid "Show last backup"
|
498 |
msgstr ""
|
499 |
|
500 |
-
#: F:\
|
501 |
#, php-format
|
502 |
msgid "Initial Backup - %s"
|
503 |
msgstr ""
|
504 |
|
505 |
-
#: F:\
|
506 |
msgid "Initial Backup"
|
507 |
msgstr ""
|
508 |
|
509 |
-
#: F:\
|
510 |
#, php-format
|
511 |
msgid "Last Backup - %s"
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: F:\
|
515 |
msgid "Last Backup"
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: F:\
|
519 |
#, php-format
|
520 |
msgid "%s (%s roles)"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: F:\
|
524 |
#, php-format
|
525 |
msgid "%s (level %s)"
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: F:\
|
529 |
msgid "Reset WordPress Defaults"
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: F:\
|
533 |
msgid "WARNING:"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: F:\
|
537 |
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: F:\
|
541 |
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: F:\
|
545 |
msgid "It is recommended to use this only as a last resource!"
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: F:\
|
549 |
msgid "Reset Roles and Capabilities to WordPress defaults"
|
550 |
msgstr ""
|
551 |
|
552 |
-
#: F:\
|
553 |
msgid ""
|
554 |
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
|
555 |
" 'Cancel' to stop, 'OK' to reset."
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: F:\
|
559 |
msgid "Reset to WordPress defaults"
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: F:\
|
563 |
#, php-format
|
564 |
msgid "All %s"
|
565 |
msgstr ""
|
566 |
|
567 |
-
#: F:\
|
568 |
msgid "Add New"
|
569 |
msgstr ""
|
570 |
|
571 |
-
#: F:\
|
572 |
msgid "Edit Roles"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: F:\
|
576 |
-
#: F:\
|
577 |
-
msgid "
|
578 |
msgstr ""
|
579 |
|
580 |
-
#: F:\
|
581 |
-
#: F:\
|
582 |
-
msgid "
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: F:\
|
586 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
msgstr ""
|
588 |
|
589 |
-
#: F:\
|
590 |
msgid "Incorrect capability name."
|
591 |
msgstr ""
|
592 |
|
593 |
-
#: F:\
|
594 |
msgid "Type / Taxonomy settings saved."
|
595 |
msgstr ""
|
596 |
|
597 |
-
#: F:\
|
598 |
msgid "Bad form received."
|
599 |
msgstr ""
|
600 |
|
601 |
-
#: F:\
|
602 |
msgid "You cannot remove Manage Capabilities from Administrators"
|
603 |
msgstr ""
|
604 |
|
605 |
-
#: F:\
|
606 |
#, php-format
|
607 |
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
|
608 |
msgstr ""
|
609 |
|
610 |
-
#: F:\
|
611 |
#, php-format
|
612 |
msgid "Role has been deleted. %1$d users moved to default role %2$s."
|
613 |
msgstr ""
|
614 |
|
615 |
-
#: F:\
|
616 |
msgid "Explicity negate this capability by storing as disabled"
|
617 |
msgstr ""
|
618 |
|
619 |
-
#: F:\
|
620 |
msgid "Explicitly negate these capabilities by storing as disabled"
|
621 |
msgstr ""
|
622 |
|
623 |
-
#: F:\
|
624 |
msgid "Post type registration does not define this capability distinctly"
|
625 |
msgstr ""
|
626 |
|
627 |
-
#: F:\
|
628 |
msgid "This capability is explicitly negated. Click to add/remove normally."
|
629 |
msgstr ""
|
630 |
|
631 |
-
#: F:\
|
632 |
msgid "Add or remove this capability from the WordPress role"
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: F:\
|
636 |
msgid "Add or remove capability from the role normally"
|
637 |
msgstr ""
|
638 |
|
639 |
-
#: F:\
|
640 |
-
#: F:\
|
641 |
-
#: F:\
|
642 |
msgid "What do you think you're doing?!?"
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: F:\
|
|
|
|
|
|
|
|
|
646 |
msgid "Bad form Received"
|
647 |
msgstr ""
|
648 |
|
649 |
-
#: F:\
|
650 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
651 |
#, php-format
|
652 |
msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
|
653 |
msgstr ""
|
654 |
|
655 |
-
#: F:\
|
656 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:46
|
657 |
#, php-format
|
658 |
msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
|
659 |
msgstr ""
|
660 |
|
661 |
-
#: F:\
|
662 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:51
|
663 |
#, php-format
|
664 |
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permission Groups%s."
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: F:\
|
668 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:53
|
669 |
#, php-format
|
670 |
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permit Groups%s."
|
671 |
msgstr ""
|
672 |
|
673 |
-
#: F:\
|
674 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:61
|
675 |
#, php-format
|
676 |
msgid "Capabilities for custom statuses can be manually added here. (See %sPermissions > Post Statuses%s for applicable names). %sSupplemental status-specific roles%s are usually more convenient, though."
|
677 |
msgstr ""
|
678 |
|
679 |
-
#: F:\
|
680 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:63
|
681 |
msgid "Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles."
|
682 |
msgstr ""
|
683 |
|
684 |
-
#: F:\
|
685 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:66
|
686 |
msgid "Capabilities for custom statuses can be manually added to a role here (see Conditions > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role."
|
687 |
msgstr ""
|
688 |
|
689 |
-
#: F:\
|
690 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:86
|
691 |
msgid "hidden role"
|
692 |
msgstr ""
|
693 |
|
694 |
-
#: F:\
|
695 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:97
|
696 |
msgid "Type-Specific Capabilities"
|
697 |
msgstr ""
|
698 |
|
699 |
-
#: F:\
|
700 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:100
|
701 |
msgid "Ensure permissions can be controlled separately from other post types."
|
702 |
msgstr ""
|
703 |
|
704 |
-
#: F:\
|
705 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:155
|
706 |
msgid "Make selected post types require a different capability to add new posts."
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: F:\
|
710 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:155
|
711 |
msgid "Use create_posts capability"
|
712 |
msgstr ""
|
713 |
|
714 |
-
#: F:\
|
715 |
-
#: F:\
|
716 |
-
#: F:\
|
717 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:160
|
718 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:221
|
719 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:277
|
720 |
msgid "Update"
|
721 |
msgstr ""
|
722 |
|
723 |
-
#: F:\
|
724 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:170
|
725 |
msgid "Taxonomy-Specific Capabilities"
|
726 |
msgstr ""
|
727 |
|
728 |
-
#: F:\
|
729 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:173
|
730 |
msgid "Ensure permissions can be controlled separately from other taxonomies."
|
731 |
msgstr ""
|
732 |
|
733 |
-
#: F:\
|
734 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:226
|
735 |
msgid "Detailed Taxonomy Capabilities"
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: F:\
|
739 |
-
#: F:\www\wp50\wp-content\plugins\capability-manager-enhanced\includes/pp-ui.php:229
|
740 |
msgid "Enforce Edit, Delete and Assign capabilities separately from Management capability."
|
741 |
msgstr ""
|
742 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Capability Manager Enhanced\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2020-01-09 12:57-0500\n"
|
6 |
+
"PO-Revision-Date: 2020-01-09 12:57-0500\n"
|
7 |
"Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
|
8 |
"Language-Team: PublishPress <help@publishpress.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
|
13 |
+
"X-Poedit-Basepath: F:\\snapshot\\capability-manager-enhanced\n"
|
14 |
"X-Poedit-Language: English\n"
|
15 |
"X-Poedit-Country: UNITED STATES\n"
|
16 |
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
+
"X-Poedit-SearchPath-0: F:\\snapshot\\capability-manager-enhanced\n"
|
18 |
+
"X-Poedit-SearchPath-1: F:\\snapshot\\capability-manager-enhanced\\includes\n"
|
19 |
|
20 |
+
#: F:\snapshot\capability-manager-enhanced/capsman-enhanced.php:40
|
21 |
+
msgid "<strong>Error:</strong> PublishPress Capabilities cannot function because another copy of Capability Manager is active."
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: F:\snapshot\capability-manager-enhanced/capsman-enhanced.php:71
|
25 |
+
msgid "<strong>This plugin can be deleted.</strong>"
|
26 |
+
msgstr ""
|
27 |
+
|
28 |
+
#: F:\snapshot\capability-manager-enhanced/capsman-enhanced.php:102
|
29 |
msgid "Warning:"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: F:\snapshot\capability-manager-enhanced/capsman-enhanced.php:103
|
33 |
#, php-format
|
34 |
msgid "The active plugin %s is not compatible with your PHP version."
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: F:\snapshot\capability-manager-enhanced/capsman-enhanced.php:105
|
38 |
#, php-format
|
39 |
msgid "%s is required for this plugin."
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: F:\snapshot\capability-manager-enhanced/framework/lib/formating.php:40
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
msgid "Settings saved."
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:38
|
47 |
#, php-format
|
48 |
msgid "Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s."
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:63
|
52 |
+
msgid "Role Capabilities"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:78
|
56 |
#, php-format
|
57 |
msgid "Capabilities for %s"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:84
|
61 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1050
|
62 |
msgid "Save Changes"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:94
|
66 |
msgid "<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:99
|
70 |
#, php-format
|
71 |
+
msgid "<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s."
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:133
|
75 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1141
|
76 |
+
msgid "PublishPress Permissions"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:135
|
80 |
msgid "Automatically define type-specific capabilities for your custom post types and taxonomies"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:139
|
84 |
msgid "Assign standard WP roles supplementally for a specific post type"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:143
|
88 |
msgid "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:147
|
92 |
msgid "Customize reading permissions per-category or per-post"
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:151
|
96 |
msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:155
|
100 |
msgid "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:159
|
104 |
msgid "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:163
|
108 |
msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:167
|
112 |
msgid "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:171
|
116 |
msgid "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:175
|
120 |
msgid "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:179
|
124 |
msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:183
|
128 |
msgid "Member support forum"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:190
|
132 |
#, php-format
|
133 |
msgid "%1$sgrab%2$s %3$s"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:190
|
137 |
#, php-format
|
138 |
msgid "%s (free install)"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:192
|
142 |
#, php-format
|
143 |
msgid "%1$sbuy%2$s %3$s"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:192
|
147 |
#, php-format
|
148 |
msgid "%s info/purchase"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:269
|
152 |
msgid " "
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:270
|
156 |
msgid "Reading"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:271
|
160 |
msgid "Editing Capabilities"
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:272
|
164 |
msgid "Deletion Capabilities"
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:276
|
168 |
msgid "can read posts which are currently published with private visibility"
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:277
|
172 |
msgid "has basic editing capability (but may need other capabilities based on post status and ownership)"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:278
|
176 |
msgid "can edit posts which were created by other users"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:279
|
180 |
msgid "can edit posts which are currently published"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:280
|
184 |
msgid "can edit posts which are currently published with private visibility"
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:281
|
188 |
msgid "can make a post publicly visible"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:282
|
192 |
msgid "has basic deletion capability (but may need other capabilities based on post status and ownership)"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:283
|
196 |
msgid "can delete posts which were created by other users"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:284
|
200 |
msgid "can delete posts which are currently published"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:285
|
204 |
msgid "can delete posts which are currently published with private visibility"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:417
|
208 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:523
|
209 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:781
|
210 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:876
|
211 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:973
|
212 |
#, php-format
|
213 |
msgid "%s: assigned by Permission Group"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:432
|
217 |
#, php-format
|
218 |
msgid "shared capability: %s"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:500
|
222 |
msgid "Other WordPress Core Capabilities"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:542
|
226 |
msgid "Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add \"dashboard_lockout_ok\" capability"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:585
|
230 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:820
|
231 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:929
|
232 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1016
|
233 |
msgid "check/uncheck all"
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:585
|
237 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:820
|
238 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:929
|
239 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1016
|
240 |
msgid "negate all (storing as disabled capabilities)"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:585
|
244 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:820
|
245 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:929
|
246 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1016
|
247 |
msgid "negate none (add/remove all capabilities normally)"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:755
|
251 |
#, php-format
|
252 |
msgid "%s Capabilities"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:828
|
256 |
msgid "Additional Capabilities"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:938
|
260 |
msgid "Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect."
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:939
|
264 |
msgid "Invalid Capabilities"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1029
|
268 |
msgid "Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1030
|
272 |
msgid "Role Level:"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1053
|
|
|
|
|
|
|
|
|
276 |
msgid "Delete this role"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1053
|
280 |
#, php-format
|
281 |
msgid ""
|
282 |
"You are about to delete the %s role.\n"
|
284 |
" 'Cancel' to stop, 'OK' to delete."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1053
|
288 |
msgid "Delete Role"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1060
|
292 |
msgid "Select New Role"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1069
|
296 |
msgid "Change"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1088
|
300 |
msgid "Create New Role"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1091
|
304 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1107
|
305 |
msgid "Role Name"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1094
|
309 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1110
|
310 |
msgid "Make role available for supplemental assignment to Permission Groups only"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1094
|
314 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1110
|
315 |
msgid "hidden"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1098
|
319 |
msgid "Create"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1104
|
323 |
msgid "Copy this role to"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1114
|
327 |
msgid "Copy"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1120
|
331 |
msgid "Add Capability"
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1123
|
335 |
msgid "Add to role"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1128
|
339 |
msgid "Backup Tool"
|
340 |
msgstr ""
|
341 |
|
342 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1130
|
343 |
msgid "Backup / Restore Roles"
|
344 |
msgstr ""
|
345 |
|
346 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1135
|
347 |
msgid "Related Permissions Plugins"
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1138
|
351 |
msgid "Multiple Authors"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1147
|
|
|
|
|
|
|
|
|
355 |
msgid "PublishPress"
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1152
|
359 |
msgid "PublishPress Revisions"
|
360 |
msgstr ""
|
361 |
|
362 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1154
|
363 |
msgid "Help / Contact Form"
|
364 |
msgstr ""
|
365 |
|
366 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1192
|
367 |
msgid "Create this role definition in new (future) sites"
|
368 |
msgstr ""
|
369 |
|
370 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1192
|
371 |
msgid "include in new sites"
|
372 |
msgstr ""
|
373 |
|
374 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1195
|
375 |
msgid "Copy / update this role definition to all sites now"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: F:\snapshot\capability-manager-enhanced/includes/admin.php:1195
|
379 |
msgid "sync role to all sites now"
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
msgid "You do not have permission to restore roles."
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:44
|
387 |
msgid "New backup saved."
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:51
|
391 |
msgid "Roles and Capabilities restored from initial backup."
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:53
|
395 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:63
|
396 |
msgid "Restore failed. No backup found."
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:61
|
400 |
msgid "Roles and Capabilities restored from last backup."
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:82
|
404 |
msgid "Needed function to create default roles not found!"
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup-handler.php:95
|
408 |
msgid "Roles and Capabilities reset to WordPress defaults"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:36
|
412 |
#, php-format
|
413 |
+
msgid "Backup Tool for %1$sPublishPress Capabilities%2$s"
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:45
|
417 |
msgid "Backup and Restore"
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:49
|
421 |
msgid "Select action:"
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:52
|
425 |
msgid "Backup roles and capabilities"
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:56
|
429 |
msgid "Restore initial backup"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:59
|
433 |
msgid "Restore last saved backup"
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:61
|
437 |
msgid "Do Action"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:69
|
441 |
msgid "Show initial backup"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:71
|
445 |
msgid "Show last backup"
|
446 |
msgstr ""
|
447 |
|
448 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:92
|
449 |
#, php-format
|
450 |
msgid "Initial Backup - %s"
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:92
|
454 |
msgid "Initial Backup"
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:93
|
458 |
#, php-format
|
459 |
msgid "Last Backup - %s"
|
460 |
msgstr ""
|
461 |
|
462 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:93
|
463 |
msgid "Last Backup"
|
464 |
msgstr ""
|
465 |
|
466 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:103
|
467 |
#, php-format
|
468 |
msgid "%s (%s roles)"
|
469 |
msgstr ""
|
470 |
|
471 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:119
|
472 |
#, php-format
|
473 |
msgid "%s (level %s)"
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:140
|
477 |
msgid "Reset WordPress Defaults"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:142
|
481 |
msgid "WARNING:"
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:142
|
485 |
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:145
|
489 |
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:146
|
493 |
msgid "It is recommended to use this only as a last resource!"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:147
|
497 |
msgid "Reset Roles and Capabilities to WordPress defaults"
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:147
|
501 |
msgid ""
|
502 |
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
|
503 |
" 'Cancel' to stop, 'OK' to reset."
|
504 |
msgstr ""
|
505 |
|
506 |
+
#: F:\snapshot\capability-manager-enhanced/includes/backup.php:147
|
507 |
msgid "Reset to WordPress defaults"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: F:\snapshot\capability-manager-enhanced/includes/filters-woocommerce.php:32
|
511 |
#, php-format
|
512 |
msgid "All %s"
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: F:\snapshot\capability-manager-enhanced/includes/filters-woocommerce.php:33
|
516 |
msgid "Add New"
|
517 |
msgstr ""
|
518 |
|
519 |
+
#: F:\snapshot\capability-manager-enhanced/includes/filters.php:275
|
520 |
msgid "Edit Roles"
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: F:\snapshot\capability-manager-enhanced/includes/functions-admin.php:7
|
524 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:274
|
525 |
+
msgid "Capabilities"
|
526 |
msgstr ""
|
527 |
|
528 |
+
#: F:\snapshot\capability-manager-enhanced/includes/functions-admin.php:29
|
529 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:296
|
530 |
+
msgid "Backup"
|
531 |
msgstr ""
|
532 |
|
533 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:18
|
534 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:31
|
535 |
+
msgid "New role created."
|
536 |
+
msgstr ""
|
537 |
+
|
538 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:24
|
539 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:37
|
540 |
+
msgid "Error: Failed creating the new role."
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:91
|
544 |
msgid "Incorrect capability name."
|
545 |
msgstr ""
|
546 |
|
547 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:96
|
548 |
msgid "Type / Taxonomy settings saved."
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:102
|
552 |
msgid "Bad form received."
|
553 |
msgstr ""
|
554 |
|
555 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:218
|
556 |
msgid "You cannot remove Manage Capabilities from Administrators"
|
557 |
msgstr ""
|
558 |
|
559 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:328
|
560 |
#, php-format
|
561 |
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
|
562 |
msgstr ""
|
563 |
|
564 |
+
#: F:\snapshot\capability-manager-enhanced/includes/handler.php:375
|
565 |
#, php-format
|
566 |
msgid "Role has been deleted. %1$d users moved to default role %2$s."
|
567 |
msgstr ""
|
568 |
|
569 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:165
|
570 |
msgid "Explicity negate this capability by storing as disabled"
|
571 |
msgstr ""
|
572 |
|
573 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:166
|
574 |
msgid "Explicitly negate these capabilities by storing as disabled"
|
575 |
msgstr ""
|
576 |
|
577 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:167
|
578 |
msgid "Post type registration does not define this capability distinctly"
|
579 |
msgstr ""
|
580 |
|
581 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:168
|
582 |
msgid "This capability is explicitly negated. Click to add/remove normally."
|
583 |
msgstr ""
|
584 |
|
585 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:169
|
586 |
msgid "Add or remove this capability from the WordPress role"
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:170
|
590 |
msgid "Add or remove capability from the role normally"
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:390
|
594 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:431
|
595 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:604
|
596 |
msgid "What do you think you're doing?!?"
|
597 |
msgstr ""
|
598 |
|
599 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:445
|
600 |
+
msgid "New capability added to role."
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:484
|
604 |
msgid "Bad form Received"
|
605 |
msgstr ""
|
606 |
|
607 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:630
|
608 |
+
#, php-format
|
609 |
+
msgid "If you like %s, please leave us a %s rating. Thank you!"
|
610 |
+
msgstr ""
|
611 |
+
|
612 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:641
|
613 |
+
msgid "About PublishPress Capabilities"
|
614 |
+
msgstr ""
|
615 |
+
|
616 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:641
|
617 |
+
msgid "About"
|
618 |
+
msgstr ""
|
619 |
+
|
620 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:643
|
621 |
+
msgid "Capabilites Documentation"
|
622 |
+
msgstr ""
|
623 |
+
|
624 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:643
|
625 |
+
msgid "Documentation"
|
626 |
+
msgstr ""
|
627 |
+
|
628 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:645
|
629 |
+
msgid "Contact the PublishPress team"
|
630 |
+
msgstr ""
|
631 |
+
|
632 |
+
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:645
|
633 |
+
msgid "Contact"
|
634 |
+
msgstr ""
|
635 |
+
|
636 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:44
|
637 |
#, php-format
|
638 |
msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
|
639 |
msgstr ""
|
640 |
|
641 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:46
|
|
|
642 |
#, php-format
|
643 |
msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
|
644 |
msgstr ""
|
645 |
|
646 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:51
|
|
|
647 |
#, php-format
|
648 |
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permission Groups%s."
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:53
|
|
|
652 |
#, php-format
|
653 |
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permit Groups%s."
|
654 |
msgstr ""
|
655 |
|
656 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:61
|
|
|
657 |
#, php-format
|
658 |
msgid "Capabilities for custom statuses can be manually added here. (See %sPermissions > Post Statuses%s for applicable names). %sSupplemental status-specific roles%s are usually more convenient, though."
|
659 |
msgstr ""
|
660 |
|
661 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:63
|
|
|
662 |
msgid "Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles."
|
663 |
msgstr ""
|
664 |
|
665 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:66
|
|
|
666 |
msgid "Capabilities for custom statuses can be manually added to a role here (see Conditions > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role."
|
667 |
msgstr ""
|
668 |
|
669 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:86
|
|
|
670 |
msgid "hidden role"
|
671 |
msgstr ""
|
672 |
|
673 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:97
|
|
|
674 |
msgid "Type-Specific Capabilities"
|
675 |
msgstr ""
|
676 |
|
677 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:100
|
|
|
678 |
msgid "Ensure permissions can be controlled separately from other post types."
|
679 |
msgstr ""
|
680 |
|
681 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:155
|
|
|
682 |
msgid "Make selected post types require a different capability to add new posts."
|
683 |
msgstr ""
|
684 |
|
685 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:155
|
|
|
686 |
msgid "Use create_posts capability"
|
687 |
msgstr ""
|
688 |
|
689 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:160
|
690 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:221
|
691 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:277
|
|
|
|
|
|
|
692 |
msgid "Update"
|
693 |
msgstr ""
|
694 |
|
695 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:170
|
|
|
696 |
msgid "Taxonomy-Specific Capabilities"
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:173
|
|
|
700 |
msgid "Ensure permissions can be controlled separately from other taxonomies."
|
701 |
msgstr ""
|
702 |
|
703 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:226
|
|
|
704 |
msgid "Detailed Taxonomy Capabilities"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: F:\snapshot\capability-manager-enhanced/includes/pp-ui.php:229
|
|
|
708 |
msgid "Enforce Edit, Delete and Assign capabilities separately from Management capability."
|
709 |
msgstr ""
|
710 |
|
readme.txt
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
-
===
|
2 |
Contributors: publishpress, kevinB, stevejburge, andergmartins
|
3 |
Tags: role, capabilities, post types, taxonomies, editor, network, woocommerce
|
4 |
-
Requires at least: 4.
|
5 |
-
Tested up to: 5.3
|
6 |
-
|
|
|
7 |
License: GPLv3
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -21,15 +22,17 @@ Control permissions requirements for your post types, and assign those capabilit
|
|
21 |
* Enable distinct edit, delete and assign capabilities for any Taxonomy
|
22 |
* Some specialized support for WooCommerce Post Types
|
23 |
* Negation: any capability can be granted, not granted, or blocked
|
24 |
-
* Integration with
|
25 |
* Network: Copy any role to all sites, or auto-copy to future sites
|
26 |
* Backup (automatic / manual) and restore roles and capabilities to revert your changes
|
27 |
|
28 |
-
|
29 |
|
30 |
It has been a reliable tool since 2012, when PublishPress team member Kevin Behrens forked it from Jordi Canals' abandoned Capability Manager plugin.
|
31 |
|
32 |
-
|
|
|
|
|
33 |
|
34 |
== Screenshots ==
|
35 |
|
@@ -37,7 +40,7 @@ For additional versatility and convenience, try <a href="https://wordpress.org/p
|
|
37 |
2. Users Menu
|
38 |
3. Network: copy Role to existing or future Sites
|
39 |
4. Role operations
|
40 |
-
5. Permissions Menu (
|
41 |
6. Shading of Capabilities granted by supplemental Type-Specific Roles
|
42 |
7. Enforce Type-Specific Capabilities
|
43 |
8. Enforce Taxonomy-Specific Capabilities
|
@@ -68,8 +71,19 @@ Yes. Users with the 'manage_capabilities' capability can edit roles. This Capabi
|
|
68 |
|
69 |
== Changelog ==
|
70 |
|
71 |
-
= 1.
|
72 |
-
* Change :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
= 1.8.1 - 25 Oct 2019 =
|
75 |
* Fixed : Automatic publication of blank auto-drafts, WooCommerce posts save with incorrect post status (since 1.8)
|
1 |
+
=== PublishPress Capabilities ===
|
2 |
Contributors: publishpress, kevinB, stevejburge, andergmartins
|
3 |
Tags: role, capabilities, post types, taxonomies, editor, network, woocommerce
|
4 |
+
Requires at least: 4.9.7
|
5 |
+
Tested up to: 5.3.2
|
6 |
+
Requires PHP: 5.6.20
|
7 |
+
Stable tag: 1.9
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
22 |
* Enable distinct edit, delete and assign capabilities for any Taxonomy
|
23 |
* Some specialized support for WooCommerce Post Types
|
24 |
* Negation: any capability can be granted, not granted, or blocked
|
25 |
+
* Integration with other PublishPress plugins for advanced permissions and comprehensive publishing solutions
|
26 |
* Network: Copy any role to all sites, or auto-copy to future sites
|
27 |
* Backup (automatic / manual) and restore roles and capabilities to revert your changes
|
28 |
|
29 |
+
PublishPress Capabilities is professionally developed and supported by the experienced <a href="https://publishpress.com">PublishPress</a> team.
|
30 |
|
31 |
It has been a reliable tool since 2012, when PublishPress team member Kevin Behrens forked it from Jordi Canals' abandoned Capability Manager plugin.
|
32 |
|
33 |
+
To control assignment of PublishPress custom statuses, upgrade to <a href="https://publishpress.com/capability-manager/">Capabilities Pro</a>.
|
34 |
+
|
35 |
+
Pro membership also provides additional versatility and convenience through <a href="https://wordpress.org/plugins/press-permit-core">PublishPress Permissions Pro</a> integration. Capabilities added indirectly by supplemental type-specific roles (Page Contributor, Product Editor, etc.) will be highlighted in the Role Capabilities editor.
|
36 |
|
37 |
== Screenshots ==
|
38 |
|
40 |
2. Users Menu
|
41 |
3. Network: copy Role to existing or future Sites
|
42 |
4. Role operations
|
43 |
+
5. Permissions Menu (PublishPress Permissions integration)
|
44 |
6. Shading of Capabilities granted by supplemental Type-Specific Roles
|
45 |
7. Enforce Type-Specific Capabilities
|
46 |
8. Enforce Taxonomy-Specific Capabilities
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 1.9 - 9 Jan 2020 =
|
75 |
+
* Change : Renamed to PublishPress Capabilities
|
76 |
+
* Feature : Capabilities link on PublishPress > Roles row opens Role Capabilities screen
|
77 |
+
* Feature : Role Capabilities screen links to PublishPress > Roles for member management
|
78 |
+
* Fixed : Browser reload caused Role Capabilities screen to display default role
|
79 |
+
* Fixed : Add Capability sidebar added custom capability to role immediately, but capability checkbox did not display as checked until reload
|
80 |
+
* Fixed : Category Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
|
81 |
+
* Fixed : Term Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
|
82 |
+
* Fixed : Multisite - On sub-sites, Role Capabilities screen did not display PublishPress Capabilities section to Super Administrators who don't have a role on the site
|
83 |
+
* Fixed : Role name captions on Role Capabilities and Backup Tool screens could not be translated
|
84 |
+
* Fixed : Checkbox bulk selection on Role Capabilities screen was incorrect under some conditions
|
85 |
+
* Change : Reinstate WordPress edit_published_posts workaround with correct status filtering behavior
|
86 |
+
* Change : Apply workaround filters for WordPress edit_published_posts / publish_posts handling only for users who have edit_published_posts capability for current post type
|
87 |
|
88 |
= 1.8.1 - 25 Oct 2019 =
|
89 |
* Fixed : Automatic publication of blank auto-drafts, WooCommerce posts save with incorrect post status (since 1.8)
|