Although $attachment_id is an integer value, it technically remains a string because that's how it's returned from the $wpdb query result. To match the DocBlock description of the return values, a call to intval has been added to ensure that the $attachment_id being return is indeed an integer.
Although
$attachment_id
is an integer value, it technically remains a string because that's how it's returned from the$wpdb
query result. To match the DocBlock description of the return values, a call tointval
has been added to ensure that the$attachment_id
being return is indeed an integer.