WordPress.org

Forums

WP Favorite Posts
Can i maintain my favourites before & after login (5 posts)

  1. kpwpradnya
    Member
    Posted 1 year ago #

    I am new for wordpress, so this might be silly question but i need suggestion on this. I am using wp_favorite_post plugin,my question is if i am adding things into my favorites before login then is it get added into my wishlist after logged in?

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. matthias_herbst
    Member
    Posted 1 year ago #

    I just wrote an extension for this plugin to automatically maintain favorites on login.

    _____

    add_action('wp_login', 'move_favorites_to_db');
    
    function move_favorites_to_db() {
    	$favorite_post_ids = wpfp_get_user_meta();
    
    	$favoriteIDs = array_keys(wpfp_get_cookie());
    	foreach($favoriteIDs as $favorite) {
    		wpfp_do_add_to_list($favorite);
    	}
    }
  3. dylanhthomas
    Member
    Posted 1 year ago #

    Where do you put this code? I tried it in the main plugin file and my functions file, and it did not work.

    Thanks!

  4. cfgmiller
    Member
    Posted 1 year ago #

    Did anyone else figure out how to get this working?

  5. Justina
    Member
    Posted 1 year ago #

    I am trying at the moment. Will post results if succeed.

    Honestly, I think it should be a setting in this plugin for this. Because now, when favorites are not maintained after login, we break the flow for the visitor. It is highly inefficient to make visitors mark their favorite posts once more.

    Dear author, please consider helping us, or updating plugin with this feature.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic