Documentation

Attachment
in package
Uses UtilsProvider

Enables the /attachments REST.

Table of Contents

Constants

MODIFIER_TYPE_BULK_MOVE  = 'bulkMove'

Methods

getPluginConstantPrefix()  : string
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
permission_callback()  : mixed
Check if user is allowed to call this service requests.
rest_api_init()  : mixed
Register endpoints.
rest_attachment_collection_params()  : array<string|int, mixed>
Extend the WP core REST API to allow orderby and rml_folder in wp-json/wp/v2/media.
rest_attachment_query()  : array<string|int, mixed>
Extend the WP core REST API to parse orderby and rml_folder in wp-json/wp/v2/media.
routeBulkMove()  : WP_REST_Response|WP_Error
See API docs.
routeShortcutInfo()  : WP_REST_Response|WP_Error
See API docs.
updateItem()  : WP_REST_Response|WP_Error
See API docs.

Constants

MODIFIER_TYPE_BULK_MOVE

public mixed MODIFIER_TYPE_BULK_MOVE = 'bulkMove'

Methods

getPluginConstantPrefix()

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

public getPluginConstantPrefix() : string
Tags
codeCoverageIgnore

It only returns a string with the constant prefix

Return values
string

permission_callback()

Check if user is allowed to call this service requests.

public permission_callback() : mixed

rest_api_init()

Register endpoints.

public rest_api_init() : mixed

rest_attachment_collection_params()

Extend the WP core REST API to allow orderby and rml_folder in wp-json/wp/v2/media.

public rest_attachment_collection_params(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Tags
since
4.5.3
Return values
array<string|int, mixed>

rest_attachment_query()

Extend the WP core REST API to parse orderby and rml_folder in wp-json/wp/v2/media.

public rest_attachment_query(array<string|int, mixed> $args, WP_REST_Request $request) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>
$request : WP_REST_Request
Tags
since
4.5.3
Return values
array<string|int, mixed>

routeBulkMove()

See API docs.

public routeBulkMove(WP_REST_Request $request) : WP_REST_Response|WP_Error
APIYes
Parameters
$request : WP_REST_Request
Tags
apiParam

{int[]} ids The post ids to move / copy

apiParam

{int} to The term id

apiParam

{boolean} isCopy If true the post is appended to the category

apiName

UpdatePostBulkMove

apiGroup

Attachment

apiVersion

1.0.0

apiPermission

upload_files

Return values
WP_REST_Response|WP_Error

routeShortcutInfo()

See API docs.

public routeShortcutInfo(WP_REST_Request $request) : WP_REST_Response|WP_Error
APIYes
Parameters
$request : WP_REST_Request
Tags
apiName

GetAttachmentShortcutInfo

apiGroup

Attachment

apiVersion

1.0.0

apiPermission

upload_files

Return values
WP_REST_Response|WP_Error

updateItem()

See API docs.

public updateItem(WP_REST_Request $request) : WP_REST_Response|WP_Error
APIYes
Parameters
$request : WP_REST_Request
Tags
apiParam

{int} folderId The folder id

apiParam

{int} attachmentId The attachment id

apiParam

{int} [nextId] The next id relative to the attachment

apiParam

{int} lastId The last id in the current sortable view

apiName

UpdateAttachment

apiGroup

Attachment

apiVersion

1.0.0

apiPermission

upload_files

apiPermission

Pro only

Return values
WP_REST_Response|WP_Error

        
On this page

Search results