Skip to content

Admin column display

Jared Novack edited this page May 28, 2014 · 7 revisions

Below are examples of values you can pass when registering a connection type to control where columns are added when viewing lists of posts in the admin:

Enabling admin columns

p2p_register_connection_type( array(
  ...
  'admin_column' => 'any'
) );

Possible values:

  • 'any' - show admin columns everywhere
  • 'from' - show the admin column only on the 'from' end
  • 'to' - show the admin column only on the 'to' end
  • false - don't show admin columns at all (default)

Customizing the headers

Since 1.5-alpha

By default, the column headers will use the title you specify for the connection. You can however change it:

p2p_register_connection_type( array(
  ...
  'from' => 'actor',
  'to' => 'movie',
  'admin_column' => 'any',
  'from_labels' => array(
    'column_title' => 'Connected Actors',
    ...
  ),
  'to_labels' => array(
    'column_title' => 'Connected Movies',
    ...
  ),
) );