media_row_actions filter-hookWP 2.8.0

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

Usage

add_filter( 'media_row_actions', 'wp_kama_media_row_actions_filter', 10, 3 );

/**
 * Function for `media_row_actions` filter-hook.
 * 
 * @param string[] $actions  An array of action links for each attachment.
 * @param WP_Post  $post     WP_Post object for the current attachment.
 * @param bool     $detached Whether the list table contains media not attached to any posts.
 *
 * @return string[]
 */
function wp_kama_media_row_actions_filter( $actions, $post, $detached ){

	// filter...
	return $actions;
}
$actions(string[])
An array of action links for each attachment.
Default: 'Edit', 'Delete Permanently', 'View'
$post(WP_Post)
WP_Post object for the current attachment.
$detached(true|false)
Whether the list table contains media not attached to any posts.
Default: true

Changelog

Since 2.8.0 Introduced.

Where the hook is called

WP_Media_List_Table::_get_row_actions()
media_row_actions
wp-admin/includes/class-wp-media-list-table.php 848
return apply_filters( 'media_row_actions', $actions, $post, $this->detached );

Where the hook is used in WordPress

Usage not found.