Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20656 closed defect (bug) (invalid)

Link Manager Custom Column

Reported by: moallemi's profile moallemi Owned by: moallemi's profile moallemi
Milestone: Priority: normal
Severity: normal Version: 3.3.2
Component: Administration Keywords:
Focuses: Cc:


WordPress has a "manage_link_custom_column" action in wp-admin/includes/class-wp-links-list-table.php line 174 that can be never called! because there is no filter to add a custom column to the link manager page and so the default switch case in line 130 never happens!

I think adding applying a filter in get_columns() function in wp-admin/includes/class-wp-links-list-table.php will solve this problem. something like:

$links_columns = apply_filters( 'manage_link_columns', $link_columns );
return $link_columns;

here is the full patched function:

function get_columns() {
		$link_columns = array(
			'cb'         => '<input type="checkbox" />',
			'name'       => _x( 'Name', 'link name' ),
			'url'        => __( 'URL' ),
			'categories' => __( 'Categories' ),
			'rel'        => __( 'Relationship' ),
			'visible'    => __( 'Visible' ),
			'rating'     => __( 'Rating' )
		return apply_filters( 'manage_link_columns', $link_columns );

Attachments (1)

class-wp-links-list-table.php (5.4 KB) - added by moallemi 12 years ago.
Patched wp file

Download all attachments as: .zip

Change History (3)

12 years ago

Patched wp file

#1 @moallemi
12 years ago

  • Owner set to moallemi
  • Status changed from new to accepted

#2 @kawauso
12 years ago

  • Keywords needs-patch has-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from accepted to closed

The action for the links table is manage_link-manager_columns and it's fired as part of get_column_headers() in wp-admin/includes/screen.php

get_columns() is already attached to this filter

Note: See TracTickets for help on using tickets.