Filter hook 'post_row_actions'

in WP Core File wp-admin/includes/class-wp-posts-list-table.php at line 1607

View Source

post_row_actions

Filter Hook
Description
Filters the array of row action links on the Posts list table. The filter is evaluated only for non-hierarchical post types.

Hook Information

File Location wp-admin/includes/class-wp-posts-list-table.php View on GitHub
Hook Type Filter
Line Number 1607

Hook Parameters

Type Name Description
string[] $actions An array of row action links. Defaults are 'Edit', 'Quick Edit', 'Restore', 'Trash', 'Delete Permanently', 'Preview', and 'View'.
WP_Post $post The post object.

Usage Examples

Basic Usage
<?php
// Hook into post_row_actions
add_filter('post_row_actions', 'my_custom_filter', 10, 2);

function my_custom_filter($actions, $post) {
    // Your custom filtering logic here
    return $actions;
}

Source Code Context

wp-admin/includes/class-wp-posts-list-table.php:1607 - How this hook is used in WordPress core
<?php
1602  			 * @param string[] $actions An array of row action links. Defaults are
1603  			 *                          'Edit', 'Quick Edit', 'Restore', 'Trash',
1604  			 *                          'Delete Permanently', 'Preview', and 'View'.
1605  			 * @param WP_Post  $post    The post object.
1606  			 */
1607  			$actions = apply_filters( 'post_row_actions', $actions, $post );
1608  		}
1609  
1610  		return $this->row_actions( $actions );
1611  	}
1612  

PHP Documentation

<?php
/**
			 * Filters the array of row action links on the Posts list table.
			 *
			 * The filter is evaluated only for non-hierarchical post types.
			 *
			 * @since 2.8.0
			 *
			 * @param string[] $actions An array of row action links. Defaults are
			 *                          'Edit', 'Quick Edit', 'Restore', 'Trash',
			 *                          'Delete Permanently', 'Preview', and 'View'.
			 * @param WP_Post  $post    The post object.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-posts-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.