Skip to content
Open
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
9 changes: 5 additions & 4 deletions src/Post_Meta/Meta_Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Meta_Map {
*
* @phpstan-ignore-next-line
*/
private $post_type = '';
private $post_type;

/** @var Meta_Group[] */
private $keys = [];
Expand Down Expand Up @@ -55,9 +55,10 @@ public function get_keys() {
* @return mixed The value for the given key
*/
public function get_value( $post_id, $key ) {
if ( isset( $this->keys[ $key ] ) ) {
return $this->keys[ $key ]->get_value( $post_id, $key );
if ( ! array_key_exists( $key, $this->keys ) ) {
return null;
}
return null;

return $this->keys[ $key ]->get_value( $post_id, $key );
}
}