ansonphong / postworld

Wordpress Theme Development Framework
GNU General Public License v2.0
7 stars 0 forks source link

get_user_vote_points () PHP Method - Creation #3

Closed ansonphong closed 10 years ago

ansonphong commented 10 years ago

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

ansonphong commented 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.

ansonphong commented 10 years ago

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

ansonphong commented 10 years ago

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 .

hmikhail commented 10 years ago

solved in commit: 5f04e2c2fb3d74184bdc6907c1dff9ca8182e31e