Skip to main content

Interface: AttachmentEntity

Defined in: packages/core/src/data/types/entities.ts:244

Interface for entities from the /wp/v2/media endpoint.

Extends

Indexable

[k: string]: unknown

Properties

_embedded

_embedded: object

Defined in: packages/core/src/data/types/entities.ts:105

author

author: AuthorEntity[]

wp:term

wp:term: TermEntity[][]

Inherited from

PostTypeEntity._embedded


alt_text

alt_text: string

Defined in: packages/core/src/data/types/entities.ts:263

Alternative text to display when attachment is not displayed.


author?

optional author: AuthorEntity[]

Defined in: packages/core/src/data/types/entities.ts:101

Inherited from

PostTypeEntity.author


caption

caption: Rendered

Defined in: packages/core/src/data/types/entities.ts:268

The attachment caption.


comment_status?

optional comment_status: "open" | "closed"

Defined in: packages/core/src/data/types/entities.ts:113

Whether or not comments are open on the object.

Inherited from

PostTypeEntity.comment_status


date

date: string

Defined in: packages/core/src/data/types/entities.ts:49

The date the object was published, in the site's timezone.

Inherited from

PostTypeEntity.date


date_gmt

date_gmt: string

Defined in: packages/core/src/data/types/entities.ts:54

The date the object was published, as GMT.

Inherited from

PostTypeEntity.date_gmt


description

description: Rendered

Defined in: packages/core/src/data/types/entities.ts:273

The attachment description.


guid

guid: Rendered

Defined in: packages/core/src/data/types/entities.ts:59

The globally unique identifier for the object.

Inherited from

PostTypeEntity.guid


id

id: number

Defined in: packages/core/src/data/types/entities.ts:74

Unique identifier for the object.

Inherited from

PostTypeEntity.id


link: string

Defined in: packages/core/src/data/types/entities.ts:79

URL to the object.

Inherited from

PostTypeEntity.link


media_details?

optional media_details: object

Defined in: packages/core/src/data/types/entities.ts:288

Details about the media file, specific to its type.

file

file: string

The file path relative to wp-content/uploads.

height

height: number

The height of the attachment.

image_meta

image_meta: Record<string, unknown>

The metadata of the attachment.

sizes

sizes: Record<string, { file: string; height: number; mime_type: string; source_url: string; width: number; }>

The different sizes that WordPress created for this attachment.

width

width: number

The width of the attachment.


media_type

media_type: "image" | "file"

Defined in: packages/core/src/data/types/entities.ts:278

Attachment type.


meta?

optional meta: Record<string, unknown>

Defined in: packages/core/src/data/types/entities.ts:253

Meta fields.


mime_type

mime_type: string

Defined in: packages/core/src/data/types/entities.ts:283

The attachment MIME type.


missing_image_sizes

missing_image_sizes: string[]

Defined in: packages/core/src/data/types/entities.ts:356

List of the missing image sizes of the attachment.


modified

modified: string

Defined in: packages/core/src/data/types/entities.ts:64

The date the object was last modified, in the site's timezone.

Inherited from

PostTypeEntity.modified


modified_gmt

modified_gmt: string

Defined in: packages/core/src/data/types/entities.ts:69

The date the object was last modified, as GMT.

Inherited from

PostTypeEntity.modified_gmt


ping_status

ping_status: "open" | "closed"

Defined in: packages/core/src/data/types/entities.ts:118

Whether or not the object can be pinged.

Inherited from

PostTypeEntity.ping_status


post

post: number

Defined in: packages/core/src/data/types/entities.ts:346

The ID for the associated post of the attachment.


slug

slug: string

Defined in: packages/core/src/data/types/entities.ts:84

An alphanumeric identifier for the object unique to its type.

Inherited from

PostTypeEntity.slug


source_url

source_url: string

Defined in: packages/core/src/data/types/entities.ts:351

URL to the original attachment file.


status

status: "publish" | "future" | "draft" | "pending" | "private"

Defined in: packages/core/src/data/types/entities.ts:89

A named status for the object.

Inherited from

PostTypeEntity.status


template?

optional template: string

Defined in: packages/core/src/data/types/entities.ts:258

The theme file to use to display the object.


terms?

optional terms: Record<string, TermEntity[]>

Defined in: packages/core/src/data/types/entities.ts:103

Inherited from

PostTypeEntity.terms


title

title: Rendered

Defined in: packages/core/src/data/types/entities.ts:99

The title for the object.

Inherited from

PostTypeEntity.title


type

type: "attachment"

Defined in: packages/core/src/data/types/entities.ts:248

Type of Post for the object.

Overrides

PostTypeEntity.type


yoast_head?

optional yoast_head: null | string

Defined in: packages/core/src/data/types/entities.ts:17

Inherited from

PostTypeEntity.yoast_head


yoast_head_json?

optional yoast_head_json: null | YoastJSON

Defined in: packages/core/src/data/types/entities.ts:16

Inherited from

PostTypeEntity.yoast_head_json