Skip to content

Commit

Permalink
Merge pull request #1159 from publishpress/hotfix-1158-listing-tab-pe…
Browse files Browse the repository at this point in the history
…rmissions-free

Capabilities screen: "Listing" tab should not require Pro version of Permissions
  • Loading branch information
olatechpro authored Sep 12, 2024
2 parents 9642afa + aa55709 commit aad7ad4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
$cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
$cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );

if (defined('PRESSPERMIT_PRO_FILE')) {
if (defined('PRESSPERMIT_VERSION') && defined('PRESSPERMIT_COLLAB_VERSION')) {
$cap_properties['list']['type'] = ['list_posts', 'list_others_posts', 'list_published_posts', 'list_private_posts'];
}

Expand All @@ -240,7 +240,7 @@
'taxonomies' => __( 'Taxonomies', 'capability-manager-enhanced' ),
);

if (defined('PRESSPERMIT_PRO_FILE')) {
if (defined('PRESSPERMIT_VERSION') && defined('PRESSPERMIT_COLLAB_VERSION')) {
$cap_type_names['list'] = __('Listing', 'capability-manager-enhanced');
}

Expand Down Expand Up @@ -270,7 +270,7 @@
'manage_categories'
);

if (defined('PRESSPERMIT_PRO_FILE')) {
if (defined('PRESSPERMIT_PRO_FILE') && defined('PRESSPERMIT_COLLAB_VERSION')) {
$default_caps = array_merge($default_caps, ['list_posts', 'list_others_posts', 'list_published_posts', 'list_private_posts', 'list_pages', 'list_others_pages', 'list_published_pages', 'list_private_pages']);
}

Expand Down Expand Up @@ -904,7 +904,7 @@

echo '</table>';

if ($cap_type === 'list' && (defined('PRESSPERMIT_VERSION') || defined('PRESSPERMIT_PRO_VERSION'))) {
if ($cap_type === 'list' && defined('PRESSPERMIT_VERSION') && defined('PRESSPERMIT_COLLAB_VERSION')) {
echo '<p class="pp-subtext"> '. esc_html__('Admin listing access is normally provided by the "Edit" capabilities. These "List" capabilities only apply if the corresponding "Edit" capability is missing. Also, these "List" capabilities can grant access, but not deny access.', 'capability-manager-enhanced') .' </p>';
}

Expand Down

0 comments on commit aad7ad4

Please sign in to comment.