apply_filters( ‘media_row_actions’, string[] $actions, WP_Post $post, bool $detached )

Filters the action links for each attachment in the Media list table.

Parameters

$actionsstring[]
An array of action links for each attachment.
Includes 'Edit', ‘Delete Permanently’, 'View', ‘Copy URL’ and ‘Download file’.
$postWP_Post
WP_Post object for the current attachment.
$detachedbool
Whether the list table contains media not attached to any posts. Default true.

Source

return apply_filters( 'media_row_actions', $actions, $post, $this->detached );

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    The above description of the $action parameter is confusing. The paramter consists of keys, which by default (as of this writing) are:
    edit, delete, view, copy, and download.

    Each key’s value is html to display in the action row.

    For example:

    array(
    'edit' => '<a href="https://example.com/wp-admin/post.php?post=123&action=edit" aria-label="Edit “YardScaping_Spring-Lawn-Article_final_5-23-08”">Edit</a>',
    'view' => '<a href="https://trustees.ddev.site/?attachment_id=43897" aria-label="View “YardScaping_Spring-Lawn-Article_final_5-23-08”" rel="bookmark">View</a>',
    ...
    )

You must log in before being able to contribute a note or feedback.