media_row_actions
Filter HookDescription
Filters the action links for each attachment in the Media list table.Hook Information
File Location |
wp-admin/includes/class-wp-media-list-table.php
View on GitHub
|
Hook Type | Filter |
Line Number | 874 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$actions
|
An array of action links for each attachment. Includes 'Edit', 'Delete Permanently', 'View', 'Copy URL' and 'Download file'. |
WP_Post
|
$post
|
WP_Post object for the current attachment. |
bool
|
$detached
|
Whether the list table contains media not attached to any posts. Default true. |
Usage Examples
Basic Usage
<?php
// Hook into media_row_actions
add_filter('media_row_actions', 'my_custom_filter', 10, 3);
function my_custom_filter($actions, $post, $detached) {
// Your custom filtering logic here
return $actions;
}
Source Code Context
wp-admin/includes/class-wp-media-list-table.php:874
- How this hook is used in WordPress core
<?php
869 * 'Copy URL' and 'Download file'.
870 * @param WP_Post $post WP_Post object for the current attachment.
871 * @param bool $detached Whether the list table contains media not attached
872 * to any posts. Default true.
873 */
874 return apply_filters( 'media_row_actions', $actions, $post, $this->detached );
875 }
876
877 /**
878 * Generates and displays row action links.
879 *
PHP Documentation
<?php
/**
* Filters the action links for each attachment in the Media list table.
*
* @since 2.8.0
*
* @param string[] $actions An array of action links for each attachment.
* Includes 'Edit', 'Delete Permanently', 'View',
* 'Copy URL' and 'Download file'.
* @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. Default true.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-admin/includes/class-wp-media-list-table.php
Related Hooks
Related hooks will be displayed here in future updates.