Skip to content

Commit

Permalink
Adjust handling for $pod_name detection to handle more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Nov 19, 2021
1 parent a833887 commit daf3c5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/PodsField.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

use Pods\Whatsit\Field;
use Pods\Whatsit\Pod;
use Pod as Pod_Deprecated;

/**
* Pods Field class for common type-specific methods.
Expand Down Expand Up @@ -382,9 +384,9 @@ public function render_input_script( $args ) {
$group_name = '';

if ( ! empty( $args->pod ) ) {
if ( $args->pod instanceof Pods ) {
if ( $args->pod instanceof Pods || $args->pod instanceof Pod_Deprecated ) {
$pod_name = $args->pod->pod_data['name'];
} else {
} elseif ( $args->pod instanceof Pod || is_array( $args->pod ) ) {
$pod_name = $args->pod['name'];
}
}
Expand Down

0 comments on commit daf3c5e

Please sign in to comment.