WordPress.org

Forums

WP Favorite Posts
[resolved] get_user_meta (2 posts)

  1. emile.swain
    Member
    Posted 1 year ago #

    Not sure if you'd done this or i did it as a result of another 3.8 issue. However i've had to update following to return the correct array structure for getting back a list of favourites.

    function wpfp_get_user_meta($user = "") {
        if (!empty($user)):
            $userdata = get_user_by( 'login', $user );
            $user_id = $userdata->ID;
            return get_user_meta($user_id, WPFP_META_KEY, true);
        else:
            return get_user_meta(wpfp_get_user_id(), WPFP_META_KEY, true);
        endif;
    }

    I've added true on the end to return the data structure not nested in an array. (i'm not currently sure what side effects this may have, but it works with my code to list favourites in my widget.

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

  2. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed. Thank you.

    You can also send pull requests via GitHub : https://github.com/hberberoglu/wp-favorite-posts

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.