media_row_actions хук-фильтрWP 2.8.0

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

Использование

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.
По умолчанию: '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.
По умолчанию: true

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

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 );

Где используется хук в WordPress

Использование не найдено.