i need to let a user to add a role from a frontend form

I think each user can only have one role. However this is how its possible to change role, if for some reason that I dont know the user can have more than one role, remove the remove role line. you can check the available roles here. $current_user = wp_get_current_user(); // Remove role $current_user->remove_role( ‘subscriber’ ); … Read more

Control Category of each user can post

I actually have a plugin that does just that, it adds a category dropdown to the user profile edit: Only user who can manage_options (admin) can see that field. and once the user is logged in to post he sees this: Update Its now in the plugin repository http://wordpress.org/extend/plugins/author-category/ enjoy.

when does output of get_user_count turns into an array?

Via: http://lists.automattic.com/pipermail/wp-hackers/2012-June/043295.html http://wordpress.org/support/topic/illegal-string-offset-total_users?replies=14#post-2893756 https://core.trac.wordpress.org/ticket/20966 I find: Normally it would return an array from the cache Meaning the return value of get_user_count() is different than in the php doc above it But… if the cache does not contain it, it will return an integer leading (in my case) to an warning (requesting an array value from … Read more

How can I let users open the site for other visitors?

Based on Bainternet’s answer to this question: Save Theme Options (options.php) From The Frontend The key is to know the name of the plugin option to Enable/Disable the Maintenance Mode. In this example, it’s named: my_maintenance_mode <?php if ( isset($_POST[‘mmode’]) && isset($_POST[‘action’]) && $_POST[‘action’] == “update_mmode” ) { if ( wp_verify_nonce( $_POST[‘theme_front_end’], ‘update-options’ ) ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)