Support » Plugin: WP Favorite Posts » get_user_meta

  • Resolved emile.swain


    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);
            return get_user_meta(wpfp_get_user_id(), WPFP_META_KEY, true);

    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.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_user_meta’ is closed to new replies.