src/Codeception/Module/WPDb.php
public function grabAttachmentMetadata($attachmentPostId)
    {
        $serializedData = $this->grabFromDatabase(
            $this->grabPostmetaTableName(),
            'meta_value',
            ['meta_key' => '_wp_attachment_metadata', 'post_id' => $attachmentPostId]
        );

        return !empty($serializedData) ?
            unserialize($serializedData)
            : [];
    }
public function grabAttachmentMetadata($attachmentPostId)
    {
        $serializedData = $this->grabFromDatabase(
            $this->grabPostmetaTableName(),
            'meta_value',
            ['meta_key' => '_wp_attachment_metadata', 'post_id' => $attachmentPostId]
        );

        return !empty($serializedData) ?
            unserialize($serializedData)
            : [];
    }
public function grabAttachmentMetadata ( $ attachmentPostId ) { $ serializedData = $ this -> grabFromDatabase ( $ this -> grabPostmetaTableName ( ) , 'meta_value' , [ 'meta_key' => '_wp_attachment_metadata' , 'post_id' => $ attachmentPostId ] ) ; return ! empty ( $ serializedData ) ? unserialize ( $ serializedData ) : [ ] ; }
Returns the metadata array for an attachment post.
This is the value of the `_wp_attachment_metadata` meta.

@example
```php
$metadata = $I->grabAttachmentMetadata($attachmentId);
$I->assertEquals(['thumbnail', 'medium', 'medium_large'], array_keys($metadata['sizes']);
```

@param int $attachmentPostId The attachment post ID.

@return array The unserialized contents of the attachment `_wp_attachment_metadata` meta or an empty array.
Returns the metadata array for an attachment post . This is the value of the _wp_attachment_metadata meta .