Skip to content

Commit

Permalink
Fix error when searching posts in the admin when set a relationship a…
Browse files Browse the repository at this point in the history
…s a filter
  • Loading branch information
rilwis committed Nov 6, 2024
1 parent 604782d commit 0b2d912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/relationship/admin-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ private function get_selected_item( string $relationship_id, string $object_type
return [];
}

$id = Arr::get( $_GET, "relationships.{$relationship_id}.ID" );
$id = (int) Arr::get( $_GET, "relationships.{$relationship_id}.ID" );
if ( empty( $id ) ) {
return [];
}

if ( $object_type === 'term' ) {
$term = get_term( $id );
Expand Down

0 comments on commit 0b2d912

Please sign in to comment.