WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show Link IDs? (3 posts)

  1. charismabiz
    Member
    Posted 7 years ago #

    I want to show link IDs on the links (blogroll) page.

    Is there an existing plugin that does this?

    If not, how would I make a plugin that shows the link ID in a column on the "Blogroll Management" page?
    ie: what're the action hooks used?

  2. charismabiz
    Member
    Posted 7 years ago #

    Update:
    It may be a filter hook (manage_link_columns) instead of an action hook. Investigating now.

    Any help/advice will be appreciated tho :)

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    This will add the column, I think:

    function add_link_id_column($link_columns)
    {
    	$id_column = array(
    	'id' => '<th>'._('ID').'</th>'
    	);
    	$link_columns=array_merge($id_column, $link_columns);
    	return $link_columns;
    }
    add_filter('manage_link_columns','add_link_id_column');

    And I think this will fill it in:

    function add_link_id_column_data($column_name, $id)
    {
    	if ($column_name == 'id')
    	{
    		echo $id;
    	}
    }
    add_action('manage_link_custom_column','add_link_id_column_data',10,2);

    I haven't tested any of this, BTW. It might have typos/minor bugs.

Topic Closed

This topic has been closed to new replies.

About this Topic