Creating permalink for user’s favorite posts
-
I would like for all users to add favorites and then share them with a link.
Is there a way to create a permalink or a URL structure that would allow anyone to visit a page displaying any users favorited posts, including anonymous users? I am using cookies only to store the data since creating an account is not in scope.
I see that I can get user favorites with
get_user_favorites_list();
but I don’t believe I will not have a user ID stored to enter into that function (Assuming that I can read an ID from a URL query string).I have a page that lists the current user’s favorited posts like so: (I am working locally so no link right now. Sorry!)
while ( have_posts() ) : the_post(); $favorites = get_user_favorites(); if ( $favorites ){ foreach($favorites as $post_id) { ...markup... } ...
Thanks for your help!
- The topic ‘Creating permalink for user’s favorite posts’ is closed to new replies.