Skip to content

Commit

Permalink
Merge pull request #1273 from publishpress/release-v2.18.0
Browse files Browse the repository at this point in the history
Release v2.18.0
  • Loading branch information
olatechpro authored Jan 9, 2025
2 parents d648597 + 3fb367a commit 29f5d40
Show file tree
Hide file tree
Showing 17 changed files with 693 additions and 482 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.17.0
* Version: 2.18.0
* Author: PublishPress
* Author URI: https://publishpress.com/
* Text Domain: capability-manager-enhanced
Expand Down Expand Up @@ -69,7 +69,7 @@
add_action('plugins_loaded', function () {

if (!defined('CAPSMAN_VERSION')) {
define('CAPSMAN_VERSION', '2.17.0');
define('CAPSMAN_VERSION', '2.18.0');
define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION);
define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION);
}
Expand Down
5 changes: 5 additions & 0 deletions common/css/admin-caps.css
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ table.pp-capabilities-cb-key td.pp-cap-x {
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
background: #fff;
font-size: initial;
position: initial;
}

.ppc-sidebar-panel .inside {
position: initial;
}

.ppc-sidebar-panel .postbox-header .hndle {
Expand Down
2 changes: 1 addition & 1 deletion common/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ ul.ppc-redirects-tab li.active a {
}

.ppc-admin-menu-rename-form .menu-title-input {
width: 200px;
width: 150px;
height: 30px;
padding: 0 8px;
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion includes/cap-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function force_distinct_taxonomy_caps() {
$custom_detailed_taxonomy_caps = true;
$generated_cap_name = str_replace('_terms', "_{$plural_type}", $replacement_cap_format);

if (!empty(get_option("cme_migrated_taxonomy_caps"))) {
if (!get_option("cme_migrated_taxonomy_caps")) {
foreach ($wp_roles->roles as $role_name => $role) {
if (!empty($role['capabilities'][$generated_cap_name])) {
$_role = get_role($role_name);
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 @@ -393,7 +393,7 @@ public static function elementsLayout()

esc_html__('Top Bar - Right', 'capability-manager-enhanced') => [
'save_draft' => ['label' => esc_html__('Save Draft'), 'elements' => '.editor-header__settings .components-button.editor-post-save-draft'],
'switch_to_draft' => ['label' => esc_html__('Switch to Draft'), 'elements' => '.editor-header__settings .components-button.editor-post-switch-to-draft'],
'switch_to_draft' => ['label' => esc_html__('Switch to Draft', 'capability-manager-enhanced'), 'elements' => '.editor-header__settings .components-button.editor-post-switch-to-draft'],
'preview' => ['label' => esc_html__('Preview'), 'elements' => '.editor-header__settings .editor-preview-dropdown, .editor-header__settings .editor-header__post-preview-button'],
'view' => ['label' => esc_html__('View'), 'elements' => '.editor-header__settings .editor-header__post-preview-button + a.components-button'],
'publish' => ['label' => esc_html__('Publish / Update', 'capability-manager-enhanced'), 'elements' => '.editor-header__settings .editor-post-publish-button__button'],
Expand Down
7 changes: 6 additions & 1 deletion includes/filters-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ function __construct() {
}

// Ensure orders can be edited or added based the edit_orders / create_orders capability
add_action( '_admin_menu', array( &$this, 'support_order_caps' ), 1 );
/**
* I believe this is outdated as order doesn't have it own menu and this implementation
* is causing shop order to lose parent menu (woocommerce) when on order page.
* I'll just comment out till I know the important of this implementation and the alternative
*/
//add_action( '_admin_menu', array( &$this, 'support_order_caps' ), 1 );
}

function implement_duplicate_product_cap( $cap ) {
Expand Down
18 changes: 9 additions & 9 deletions includes/functions-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,15 @@ function pp_capabilities_sub_menu_lists($cme_fakefunc = false) {
'callback' => $cme_fakefunc ? 'cme_fakefunc' : [$capsman, 'ManageFrontendFeatures'],
'dashboard_control' => true,
];
if ($cme_fakefunc) {
$sub_menu_pages['admin-menus'] = [
'title' => __('Admin Menus', 'capability-manager-enhanced'),
'capabilities' => $super_user ? 'read' : 'manage_capabilities_admin_menus',
'page' => 'pp-capabilities-admin-menus',
'callback' => 'cme_fakefunc',
'dashboard_control' => true,
];
}
$sub_menu_pages['profile-features'] = [
'title' => __('Profile Features', 'capability-manager-enhanced'),
'capabilities' => $super_user ? 'read' : 'manage_capabilities_profile_features',
Expand All @@ -479,15 +488,6 @@ function pp_capabilities_sub_menu_lists($cme_fakefunc = false) {
'callback' => $cme_fakefunc ? 'cme_fakefunc' : [$capsman, 'ManageRedirects'],
'dashboard_control' => true,
];
if ($cme_fakefunc) {
$sub_menu_pages['admin-menus'] = [
'title' => __('Admin Menus', 'capability-manager-enhanced'),
'capabilities' => $super_user ? 'read' : 'manage_capabilities_admin_menus',
'page' => 'pp-capabilities-admin-menus',
'callback' => 'cme_fakefunc',
'dashboard_control' => true,
];
}
$sub_menu_pages['nav-menus'] = [
'title' => __('Nav Menus', 'capability-manager-enhanced'),
'capabilities' => $super_user ? 'read' : 'manage_capabilities_nav_menus',
Expand Down
5 changes: 5 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ function ppc_test_user_init () {
* @param int $user_id The user ID.
*/
function ppc_role_redirect_after_registration($user_id) {
// Skip redirection if the request is from the admin area.
if (is_admin()) {
return;
}

$user = get_user_by('ID', $user_id);

if (pp_capabilities_feature_enabled('redirects') && is_object($user) && isset($user->roles) && is_array($user->roles)) {
Expand Down
3 changes: 0 additions & 3 deletions includes/roles/roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
<form action="" method="post">
<?php $table->display(); //Display the table ?>
</form>
<div class="form-wrap edit-term-notes">
<p><?php esc_html__('Description here.', 'capability-manager-enhanced') ?></p>
</div>
</div>
</div>
<form method="get">
Expand Down
Binary file modified languages/capability-manager-enhanced-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 29f5d40

Please sign in to comment.