WordPress.org

Support

Support » Plugins and Hacks » [Resolved] get_user_meta

[Resolved] get_user_meta

  • 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/

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