Tag: acf

  • Build Log 002 — Messages Feed Connected

    Today we connected the My Room Messages section to real message data.

    The Messages section is no longer only static placeholder content. It now pulls from a private Messages custom post type and displays published messages assigned to the current logged-in user.

    What was completed:

    • Created and tested the Messages CPT
    • Confirmed the post type slug is message
    • Added ACF message fields for sender, recipient, status, and type
    • Diagnosed why messages were not appearing
    • Found that ACF fields were inside a parent Group field named message_fields
    • Updated the query to use the correct stored meta keys
    • Confirmed recipient-based message targeting works
    • Displayed real messages inside the My Room Signal Feed

    Important technical note:

    Because the ACF fields are inside a Group field named message_fields, the saved meta keys are prefixed.

    The recipient field is queried as:

    message_fields_nsm_recipient_id

    The message type is read as:

    message_fields_nsm_message_type

    The message status is read as:

    message_fields_nsm_message_status

    Current result:

    The My Room page now shows real Messages posts in the Signal Feed when the current logged-in user matches the message recipient ID.

    Next possible step:

    Create a front-end Send Message form so users can send messages without using wp-admin.