Closed ansonphong closed 10 years ago
This is a useful method for getting the user 'roles' by user id, since a user in some cases can be assigned to multiple roles: http://www.peterrknight.com/get-wordpress-user-role-by-id/
If they have multiple roles, we can default to the role with the higher vote_points.
I just added this role : get_user_roles() from the site into postworld_users.php, so we can use that function in-line. See more in documentation : https://www.evernote.com/shard/s275/sh/7fd5bb62-0902-4050-9889-338f847d044c/5fe6f3da3510557663e8693251ac8557
Yes, we will use this table instead of WP options.
On Tue, Sep 10, 2013 at 6:16 AM, hmikhail notifications@github.com wrote:
Question: are you going to remove the roles configuration from word press options and use this table?
— Reply to this email directly or view it on GitHubhttps://github.com/phongmedia/postworld/issues/3#issuecomment-24158377 .
solved in commit: 5f04e2c2fb3d74184bdc6907c1dff9ca8182e31e
Hi Haidy, I modified the postworld_install_data() function so that it pre-populates the wp_postworld_user_roles table with the basic necessary to start working on the get_user_vote_points () function.
If you de-activate and then re-activate the Postworld plugin in the Wordpress plugins manager, you should see this data in place.
Administrator 10 Editor 5 Author 2 Contributor 1 Default 1