Skip to content
This repository

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',
    ...
  ),
) );
Something went wrong with that request. Please try again.