Custom Fields
Re-Envisioned
Support MB Relationships Get Relationship Metabox Title

  • Creator
    Topic
  • #27714
    Resolved Ryan Oliver
    Participant

    How can I retrieve the title of the Meta Field used to define a Relationship?

    I'd like to render the title of the Relationship Metabox field in my page template.

    Screenshot of MB Relationshps Metabox Title

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #27740
    Long Nguyen
    Moderator

    Hi Ryan,

    Each relationship meta box has an ID: {$relationship_id}_relationships_from and {$relationship_id}_relationships_to. You can use these IDs to get the meta box registry information. For example

    $meta_box_registry = rwmb_get_registry( 'meta_box' );
    $registry = $meta_box_registry->get('{$relationship_id}_relationships_from');

    Get more details here https://docs.metabox.io/rwmb-get-registry/

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.