From 32d62a718ab898651ed965eda62e16b5382857da Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Sun, 18 Aug 2024 11:35:45 -0500 Subject: [PATCH] Fix slug/id check for tests --- includes/general.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/general.php b/includes/general.php index b2b5925d81..82c60b25cc 100644 --- a/includes/general.php +++ b/includes/general.php @@ -1536,13 +1536,15 @@ function pods_shortcode_detect_context( array $attributes ) : ?string { $context = 'related-item-list'; } else { $template_custom = $attributes['template_custom'] ?? ''; - $field = $attributes['field'] ?? $attributes['col'] ?? ''; + $field = $attributes['field'] ?? $attributes['col'] ?? ''; + $slug = $attributes['slug'] ?? ''; + $id = $attributes['id'] ?? ''; if ( false !== strpos( $template_custom, '{@_all_fields' ) ) { $context = 'item-single-list-fields'; } elseif ( '' !== $field ) { $context = 'field'; - } elseif ( $attributes['slug'] ?? null || $attributes['id'] ?? null ) { + } elseif ( ! empty( $slug ) || ! empty( $id ) ) { $context = 'item-single'; } else { $context = 'item-list';