Skip to content

Commit

Permalink
Merge pull request #1204 from publishpress/release-v2.15.0
Browse files Browse the repository at this point in the history
Release v2.15.0
  • Loading branch information
olatechpro authored Nov 13, 2024
2 parents 10696be + 9c5bfc2 commit 9c84a17
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 27 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.14.0
* Version: 2.15.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.14.0');
define('CAPSMAN_VERSION', '2.15.0');
define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION);
define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION);
}
Expand Down
102 changes: 89 additions & 13 deletions common/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ table#akmin tr td input[type=checkbox] {
.pp-capability-menus-wrapper:not(.nav-menus) .pp-capability-menus .menu-item-link:hover,
.pp-capability-menus-wrapper:not(.nav-menus) .pp-capability-menus .menu-item-link:focus {
cursor: pointer;
border-color: transparent;
}

.pp-capability-menus-wrapper.nav-menus .pp-capability-menus-select.fse-nav-menu .ppc-nav-item-title {
Expand Down Expand Up @@ -1636,29 +1637,104 @@ ul.pp-capabilities-description {
}



.ppc-admin-menu-rename-form .cancel-menu-title {
padding: 0;
width: 30px;
height: 30px;
min-height: 30px;
display: inline-flex;
align-items: center;
justify-content: center;
}

.ppc-admin-menu-rename-form .cancel-menu-title .dashicons {
font-size: 16px;
width: 16px;
height: 16px;
color: #a00;
}

.ppc-admin-menu-rename-form .cancel-menu-title:hover .dashicons {
color: #dc3232;
}

.ppc-admin-menu-rename-form {
display: inline-flex;
align-items: center;
gap: 5px;
}

.ppc-admin-menu-rename-form .menu-title-input {
width: 200px;
height: 30px;
padding: 0 8px;
margin: 0;
line-height: 28px;
border-radius: 4px;
}

.ppc-admin-menu-rename-form .save-menu-title,
.ppc-admin-menu-rename-form .cancel-menu-title {
padding: 0;
width: 30px;
height: 30px;
min-height: 30px;
display: inline-flex;
align-items: center;
justify-content: center;
margin: 0;
border-radius: 4px;
}

.ppc-admin-menu-rename-form .save-menu-title .dashicons,
.ppc-admin-menu-rename-form .cancel-menu-title .dashicons {
font-size: 16px;
width: 16px;
height: 16px;
}

.ppc-admin-menu-rename-form .save-menu-title .dashicons {
color: #2271b1;
}

.ppc-admin-menu-rename-form .cancel-menu-title .dashicons {
color: #a00;
}

.ppc-admin-menu-rename-form .save-menu-title:hover .dashicons {
color: #0a4b78;
}

.ppc-admin-menu-rename-form .cancel-menu-title:hover .dashicons {
color: #dc3232;
}



.ppc-floating-status {
position: fixed;
bottom: 20px;
left: 184px;
background: #2c3338;
padding: 10px 15px;
border-radius: 4px;
right: 50px;
margin-bottom: 10px;
transition: all 0.5s ease-out;
box-shadow: 0 0 15px #999;
z-index: 999;
z-index: 9999999999999;
-webkit-backdrop-filter:blur(16px) saturate(180%);
backdrop-filter:blur(16px) saturate(180%);
background:#000000d9;
border-radius:2px;
box-shadow:0 .7px 1px #0000001a,0 1.2px 1.7px -.2px #0000001a,0 2.3px 3.3px -.5px #0000001a;
box-sizing:border-box;
color:#fff;
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
font-size:13px;
padding:12px 20px;
}
@media (max-width: 782px) {
.ppc-floating-status {
left: 60px;
}
}
.ppc-floating-status.ppc-floating-status--success {
color: #00d084;
}
.ppc-floating-status.ppc-floating-status--error {
color: #d63638;
}

.ppc-hide-menu-item {
display:none !important
Expand Down Expand Up @@ -1766,4 +1842,4 @@ ul.pp-capabilities-description {
padding: 0;
margin-top: 30px;
}
}
}
2 changes: 1 addition & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
$pp_ui->show_capability_hints( $default );
}

if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
global $wp_roles;
global $wpdb;

Expand Down
4 changes: 2 additions & 2 deletions includes/handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function processAdminGeneral() {

// Save role changes. Already saved at start with self::saveRoleCapabilities()
} elseif ( ! empty($_POST['SaveRole']) && !empty($_POST['current'])) {
if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}

Expand Down Expand Up @@ -81,7 +81,7 @@ function processAdminGeneral() {
}
// Create New Capability and adds it to current role.
} elseif (!empty($_POST['AddCap']) && !empty($_POST['current']) && !empty($_POST['capability-name'])) {
if ( MULTISITE ) {
if ( defined( 'MULTISITE' ) && MULTISITE ) {
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}

Expand Down
8 changes: 4 additions & 4 deletions includes/roles/class/class-pp-roles-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,11 @@ protected function column_name($item)
['page' => 'pp-capabilities-roles', 'add' => 'new_item', 'role_action' => 'edit', 'role' => esc_attr($item['role'])],
admin_url('admin.php')
),
esc_html($item['name']),
esc_html(translate_user_role($item['name'])),
$role_states
);
} else {
$out = esc_html($item['name']);
$out = esc_html(translate_user_role($item['name']));
}

return $out;
Expand All @@ -380,7 +380,7 @@ protected function column_name($item)
protected function column_text($item)
{

return !empty($item['name']) ? $item['name'] : '—';
return !empty($item['name']) ? translate_user_role($item['name']) : '—';
}

/**
Expand Down Expand Up @@ -625,7 +625,7 @@ public function prepare_items()
if ((!empty($_REQUEST['s'])) && $search = sanitize_text_field($_REQUEST['s'])) {
$data_filtered = [];
foreach ($data as $item) {
if ($this->str_contains($item['role'], $search, false) || $this->str_contains($item['name'], $search, false)) {
if ($this->str_contains($item['role'], $search, false) || $this->str_contains(translate_user_role($item['name']), $search, false)) {
$data_filtered[] = $item;
}
}
Expand Down
8 changes: 4 additions & 4 deletions languages/capability-manager-enhanced.pot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-10-22 09:43+0000\n"
"POT-Creation-Date: 2024-11-12 14:42+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Domain: capability-manager-enhanced\n"
Expand Down Expand Up @@ -1096,7 +1096,7 @@ msgid ""
msgstr ""

#: includes/admin.php:1835
msgid "include in new sites"
msgid "Include in new sites."
msgstr ""

#: includes/handler.php:119
Expand Down Expand Up @@ -1814,11 +1814,11 @@ msgid "Status & visibility"
msgstr ""

#: includes/admin.php:1841
msgid "sync options to all sites now"
msgid "Sync options to all sites."
msgstr ""

#: includes/admin.php:1838
msgid "sync role to all sites now"
msgid "Sync role to all sites."
msgstr ""

#: includes/roles/class/class-pp-roles-list-table.php:92
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
Requires at least: 5.5
Requires PHP: 7.2.5
Tested up to: 6.6
Stable tag: 2.14.0
Stable tag: 2.15.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

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

== Changelog ==

= 2.15.0 - 13 Nov 2024 =
* Feature : Reorder and rename admin menus for roles [PRO], #254
* Fixed : Fatal error: Uncaught Error: Undefined constant "MULTISITE", #1187
* Update : German translation Update, #1192
* Update : Brazil Translation for PRO, #1191
* Update : Capabilities FREE Translation Updates v. 2.14.0, #1186

= 2.14.0 - 22 Oct 2024 =
* Update : Editor feature not working due to duplicate inline css, #1148
* Fixed : Editor Features not working for some items, #1145
Expand Down

0 comments on commit 9c84a17

Please sign in to comment.