Custom Fields
Re-Envisioned
Support MB Relationships Create User “Favorites”?

  • Creator
    Topic
  • #17854
    TravisEstes
    Participant

    Is there a way to create User “Favorites” using MB Relationships and Front End Forms?

    So basically:
    – User clicks a button to mark a post or User a “Favorite”
    – That user’s favorites can be displayed in a list for them
    – Users can have multiple favorites. Their favorites are unique to them

    I’m currently using another plugin for this that doesn’t feel super stable, so wondering if there’s a way to do this with MB’s! I have tried but can’t figure this out.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #17861
    Anh Tran
    Keymaster

    Hi,

    Thanks for asking a great question.

    While I think it’s totally doable with Meta Box, it requires custom coding. I imagine the steps will be like this:

    User clicks a button to mark a post or User a “Favorite”

    • Add a custom link to the post for users to mark as a favorite
    • When clicking that link, send an Ajax request to do the job
    • In the Ajax callback, use MB_Relationship_API::add to create connections between users and posts

    That user’s favorites can be displayed in a list for them

    This can be done with the code in the documentation.

    Users can have multiple favorites. Their favorites are unique to them

    Just set the relationship as many-to-many (default) and MB Relationships can handle the rest.

    I hope that can give you some ideas. Unfortunately, I can’t provide ready-to-use code.

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

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash