Get Relationship Metabox Title

Support MB Relationships Get Relationship Metabox TitleResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27714
    Ryan OliverRyan 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

    #27740
    Long NguyenLong 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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.