Allow user to view and manage wp_usermeta data on page

I am using a “Favorites” plugin, and I need to show the posts (CPT) that a user has favorited, and allow them to manage (remove) them.

Thus Goals Are:

1. Show the posts they have favorited (I guess via a Query Loop that can access the wp_usermeta df_favorites key).

2. Allow them to “unfavorite” a CPT via a trash icon (with or without a “Save” button being necessary).

3. Facilitate a login flow*

Here’s an example row from the wp_usermeta table, showing that a user has favorited 4 posts:

umeta_id user_id meta_key meta_value
311 8 df_favorites a:4:{i:0;i:5211;i:1;i:5246;i:2;i:5209;i:3;i:5264;}

*I would add one more thing here for completeness of use case:

This page should not be accessible if the user signed out (it would be empty). So I imagine a flow where if they try to access the page while signed out, they are redirected to the login page (or a login form is present instead), and then upon login, redirected back to the page (or the login form disappears / the page is reloaded).

TBH I’m not sure how that last requirement touches Bricks, but wanted to include it for completeness.

  1. What of this can be done with Bricks out of the box, if anything?

  2. What requires custom coding, but can still use Bricks/Bricksforge?

I implemented this for the woocommerce products but this can be applied to any post type really check it out

ask to chatgpt if you need changes or to learn how it works.

I used this on couple projects already it works fine

1 Like

I ended up just coding all the frontend behavior as a shortcode and not using Bricks at all.