Skip to content

Commit 67c129a

Browse files
committed
Fix issue accessing fields on Snippet class.
1 parent 9e53f25 commit 67c129a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

php/class-data-item.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ public function get_allowed_fields(): array {
204204
* @return bool true if the is allowed, false if invalid.
205205
*/
206206
public function is_allowed_field( string $field ): bool {
207-
return isset( $this->fields[ $field ] ) || isset( $this->field_aliases[ $field ] );
207+
return $this->fields && array_key_exists( $field, $this->fields ) ||
208+
$this->field_aliases && array_key_exists( $field, $this->field_aliases );
208209
}
209210

210211
/**

0 commit comments

Comments
 (0)