Skip to content

Patch track by index

PATCH
/wp-json/wp2/media-subtitles-timecodes/v1/attachments/{id}/tracks/{index}
curl --request PATCH \
--url https://example.com/wp-json/wp2/media-subtitles-timecodes/v1/attachments/1/tracks/1 \
--header 'Content-Type: application/json' \
--header 'X-WP-Nonce: <X-WP-Nonce>' \
--data '{ "kind": "subtitles", "src": "https://example.com", "srclang": "example", "label": "example", "default": "example" }'

Patches one track by numeric index in the list (language, label, content, and so on).

id
required
integer

Numeric entity id.

index
required
integer

Track index in the list.

Media typeapplication/json
object
kind

Field “kind” as returned or accepted by PHP.

string
Allowed values: subtitles captions chapters
src

Dynamic Shortcode island source.

string format: uri
srclang

Field “srclang” as returned or accepted by PHP.

string
label

Product label.

string
default

Field “default” as returned or accepted by PHP.

string
Media typeapplication/json
object
kind

Field “kind” as returned or accepted by PHP.

string
Allowed values: subtitles captions chapters
src

Dynamic Shortcode island source.

string format: uri
srclang

Field “srclang” as returned or accepted by PHP.

string
label

Product label.

string
default

Field “default” as returned or accepted by PHP.

string
Example
{
"kind": "subtitles"
}

Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}