Skip to content

Commit

Permalink
Merge pull request #830 from publishpress/release-v2.8.1
Browse files Browse the repository at this point in the history
Release v2.8.1
  • Loading branch information
olatechpro authored May 17, 2023
2 parents 382b322 + 9fea21a commit 52ee23f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 17 deletions.
4 changes: 2 additions & 2 deletions capsman-enhanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PublishPress Capabilities
* Plugin URI: https://publishpress.com/capability-manager/
* Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
* Version: 2.8.0
* Version: 2.8.1
* Author: PublishPress
* Author URI: https://publishpress.com/
* Text Domain: capsman-enhanced
Expand Down Expand Up @@ -44,7 +44,7 @@
}

if (!defined('CAPSMAN_VERSION')) {
define('CAPSMAN_VERSION', '2.8.0');
define('CAPSMAN_VERSION', '2.8.1');
define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION);
define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION);
}
Expand Down
10 changes: 5 additions & 5 deletions common/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,11 @@ table#akmin .pp-capability-menus-select .restrict-column {
clear: none !important;
}


table#akmin .pp-capability-menus-select .restrict-column + .menu-column.ppc-menu-item {
width: 100%;
}

.pp-capability-menus .menu-item-link {
display: inline;
color: #0073aa;
Expand Down Expand Up @@ -825,11 +830,6 @@ div.ppc-editor-features-classic-toggle {
margin-left: 40px;
}

.pp-capability-menus-wrapper.profile-features table#akmin .pp-capability-menus-select .restrict-column {
width: 0;
min-width: 70px;
}

.publishpress-caps-settings .description {
vertical-align: text-bottom;
}
Expand Down
3 changes: 2 additions & 1 deletion includes/admin-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function __construct() {
require_once ( dirname(CME_FILE) . '/includes/manager.php' );
$capsman = new CapabilityManager();
} else {
add_action( 'admin_menu', [$this, 'cmeSubmenus'], 20 );
add_action( 'admin_menu', [$this, 'cmeSubmenus'], 18 );
}

add_action('init', function() { // late execution avoids clash with autoloaders in other plugins
Expand Down Expand Up @@ -453,6 +453,7 @@ function cmeSubmenus() {
$cap_callback = false;
$cap_page_slug = false;
$cap_title = __('Capabilities', 'capsman-enhanced');
$cap_name = false;
if (is_multisite() && is_super_admin()) {
$cap_name = 'read';
$cap_callback = [$this, 'dashboardPage'];
Expand Down
2 changes: 1 addition & 1 deletion includes/features/restrict-editor-features.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public static function elementsLayout()
'preview' => ['label' => esc_html__('Preview', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .block-editor-post-preview__dropdown'],
'publish' => ['label' => esc_html__('Publish / Update', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .editor-post-publish-button__button'],
'settings' => ['label' => esc_html__('Settings', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .interface-pinned-items button'],
'options' => ['label' => esc_html__('Options', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .edit-post-more-menu .components-button'],
'options' => ['label' => esc_html__('Options', 'capsman-enhanced'), 'elements' => '.edit-post-header__settings .edit-post-more-menu .components-button, .edit-post-header__settings .components-dropdown-menu.interface-more-menu-dropdown'],
],

esc_html__('Body', 'capsman-enhanced') => [
Expand Down
12 changes: 6 additions & 6 deletions includes/functions-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,32 +319,32 @@ function pp_capabilities_dashboard_options() {

$features['roles'] = [
'label' => esc_html__('Roles', 'capsman-enhanced'),
'description' => esc_html__('Create, edit, and delete user roles.', 'capsman-enhanced'),
'description' => esc_html__('Roles allows you to create, edit, and delete all the user roles on your site.', 'capsman-enhanced'),
];

$features['capabilities'] = [
'label' => esc_html__('Capabilities', 'capsman-enhanced'),
'description' => esc_html__('Add or remove capabilities from any user role.', 'capsman-enhanced'),
'description' => esc_html__('Capabilities allows you to change the permissions for any user role.', 'capsman-enhanced'),
];

$features['editor-features'] = [
'label' => esc_html__('Editor Features', 'capsman-enhanced'),
'description' => esc_html__('Remove elements from the post editing screen.', 'capsman-enhanced'),
'description' => esc_html__('Editor Features allows you to remove elements from the post editing screen.', 'capsman-enhanced'),
];

$features['admin-features'] = [
'label' => esc_html__('Admin Features', 'capsman-enhanced'),
'description' => esc_html__('Remove elements from the admin area and toolbar.', 'capsman-enhanced'),
'description' => esc_html__('Admin Features allows you to remove elements from the admin area and toolbar.', 'capsman-enhanced'),
];

$features['profile-features'] = [
'label' => esc_html__('Profile Features', 'capsman-enhanced'),
'description' => esc_html__('Remove elements from the Profile screen.', 'capsman-enhanced'),
'description' => esc_html__('Profile Features allows you to remove elements from the Profile screen.', 'capsman-enhanced'),
];

$features['nav-menus'] = [
'label' => esc_html__('Nav Menus', 'capsman-enhanced'),
'description' => esc_html__('Block access to frontend menu links.', 'capsman-enhanced'),
'description' => esc_html__('Nav Menus allows you to block access to frontend menu links.', 'capsman-enhanced'),
];

$features['user-testing'] = [
Expand Down
7 changes: 6 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ function pp_capabilities_parse_nav_block($parsed_block, $menu_items, $parent = 0
'ID' => $block_id,
'title' => ppc_block_menu_icon($parsed_block['blockName']) . ' ' . $block_attrs['label'],
'object_id' => $parsed_block['blockName'],
'object' => 'custom_block',
'object' => 'custom_block_' . sanitize_title_with_dashes($block_attrs['label']),
'menu_item_parent' => $parent,
'ancestor_class' => $ancestor_class,
'is_parent_page' => !empty($inner_blocks) ? 1 : 0,
Expand Down Expand Up @@ -964,9 +964,14 @@ function pp_capabilities_fse_nav_menu_permission($inner_blocks) {
$block_details = $inner_block->parsed_block;
$block_name = isset($block_details['blockName']) ? $block_details['blockName'] : false;
$block_attrs = isset($block_details['attrs']) ? (array)$block_details['attrs'] : false;
$block_label = (isset($block_attrs['label'])) ? $block_attrs['label'] : false;
$block_id = isset($block_attrs['id']) ? $block_attrs['id'] : 0;
if (in_array($block_name, ['core/site-logo', 'core/site-title', 'core/social-links', 'core/search', 'core/home-link']) && in_array($block_name, $fse_blocked_nav_links)) {
//unset core nav block
$removeable_keys[] = $key_offset;
} elseif ($block_label && in_array($block_id . '_custom_block_' . sanitize_title_with_dashes($block_label), $disabled_nav_menu_array)) {
//unset custom block that doesn't have ID identifier
$removeable_keys[] = $key_offset;
} elseif (is_array($block_attrs) && isset($block_attrs['url']) && in_array($block_attrs['url'], $fse_blocked_nav_links)) {
//unset custom links
$removeable_keys[] = $key_offset;
Expand Down
1 change: 1 addition & 0 deletions includes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ public function cme_menu() {
$cap_callback = false;
$cap_page_slug = false;
$cap_title = __('Capabilities', 'capsman-enhanced');
$cap_name = false;
if (is_multisite() && is_super_admin()) {
$cap_name = 'read';
$cap_callback = [$this, 'dashboardPage'];
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: capabilities, permissions, admin menus, user roles, user role editor, acce
Requires at least: 4.9.7
Tested up to: 6.2
Requires PHP: 5.6.20
Stable tag: 2.8.0
Stable tag: 2.8.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -410,6 +410,13 @@ Fixed : Security issue. Please update.

== Changelog ==

= 2.8.1 - 17 May 2023 =
* Fixed : Undefined variable $cap_name, #822
* Fixed : Full Site Editing admin menus issue with custom link, #807
* Fixed : Profile Features table safari styles fix, #770
* Fixed : Update dashboard feature texts, #820
* Fixed : Editor Feature Options not hiding, #805

= 2.8.0 - 11 May 2023 =
* Feature : Custom capabilities for each feature/menu, #727
* Feature : Allow users to disable some features [Dashboard Menu], #491
Expand Down

0 comments on commit 52ee23f

Please sign in to comment.