Filter hook 'list_table_primary_column'

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

View Source

list_table_primary_column

Filter Hook
Description
Filters the name of the primary column for the current list table.

Hook Information

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

Hook Parameters

Type Name Description
string $default Column name default for the specific list table, e.g. 'name'.
string $context Screen ID for specific list table, e.g. 'plugins'.

Usage Examples

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

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

Source Code Context

wp-admin/includes/class-wp-list-table.php:1287 - How this hook is used in WordPress core
<?php
1282  		 * @since 4.3.0
1283  		 *
1284  		 * @param string $default Column name default for the specific list table, e.g. 'name'.
1285  		 * @param string $context Screen ID for specific list table, e.g. 'plugins'.
1286  		 */
1287  		$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
1288  
1289  		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
1290  			$column = $default;
1291  		}
1292  

PHP Documentation

<?php
/**
		 * Filters the name of the primary column for the current list table.
		 *
		 * @since 4.3.0
		 *
		 * @param string $default Column name default for the specific list table, e.g. 'name'.
		 * @param string $context Screen ID for specific list table, e.g. 'plugins'.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.