Admin Columns
[resolved] Support for wp-types post relationships (5 posts)

  1. Mikkel Breum
    Posted 3 years ago #

    I'm using wp-types to create parent-child relationships between custom post types. I'd like to be able to show these in a column. I'd like to be able to choose between displaying the Title or an active (clickable) link to the parent of a given entry.

    Alternatively – if this is outside of your development scope – I'd like to be able to add a cloumn for a custom field that is hidden (fields where the name starts with an underscore).. Could this be implementet?


  2. Mikkel Breum
    Posted 3 years ago #

    The parent relationship for a child post is stored using the _variable_ field name _wpcf_belongs_[CPTSLUG]_id where [CPTSLUG] is the slug of the CPT that the parent relationship regards (a CPT can have multiple parents, one parent for each CPT), so if a post has a parent of type authors (authors being the slug of the parent CPT), the relationship would be stored in the field named _wpcf_belongs_authors_id

    The field would hold the post ID.

  3. Tobias Schutter
    Plugin Author

    Posted 3 years ago #

    To enable Hidden custom field you only need to add this line of code to your themes functions.php:

    add_filter('cpac_use_hidden_custom_fields', '__return_true'); // enables the use hidden custom fields

    More cool stuff in the FAQ section of the plugin.

  4. Mikkel Breum
    Posted 3 years ago #

    Thanks, that was very useful.

  5. Hassan
    Posted 3 years ago #

    Hey Mikkel, did you find a way to display the parent post's title in the column instead of its ID?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Admin Columns
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic