Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion classes/PodsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,20 @@ public function admin_menu() {

if ( ! empty( $settings ) ) {
foreach ( (array) $settings as $pod ) {
if ( ! pods_is_admin( [ 'pods', 'pods_content', 'pods_edit_' . $pod['name'] ] ) ) {
$settings_capabilities = [
'pods',
'pods_content',
'pods_edit_' . $pod['name'],
];

if (
'custom' === pods_v( 'capability_type', $pod['options'] )
&& ! empty( $pod['options']['capability_type_custom'] )
) {
$settings_capabilities[] = (string) $pod['options']['capability_type_custom'];
}

if ( ! pods_is_admin( $settings_capabilities ) ) {
continue;
}

Expand Down Expand Up @@ -3991,6 +4004,13 @@ public function admin_capabilities( $capabilities ) {
foreach ( $pods as $pod ) {
if ( 'settings' === $pod['type'] ) {
$capabilities[] = 'pods_edit_' . $pod['name'];

if (
'custom' === pods_v( 'capability_type', $pod['options'] )
&& ! empty( $pod['options']['capability_type_custom'] )
) {
$capabilities[] = (string) $pod['options']['capability_type_custom'];
}
} elseif ( 'post_type' === $pod['type'] ) {
$capability_type = pods_v_sanitized( 'capability_type_custom', $pod['options'], pods_v( 'name', $pod ) );

Expand Down
19 changes: 19 additions & 0 deletions src/Pods/Admin/Config/Pod.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.