Skip to content

Commit

Permalink
Fix slug/id check for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Aug 18, 2024
1 parent 0ff135e commit 32d62a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 32d62a7

Please sign in to comment.