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

Assign a category by user and customize the edit-tags.php?taxonomy=category page

This is how I did it : function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user->ID); $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘edit-tags.php’)); if (is_admin() && $onPostPage && !current_user_can(‘level_10’)) { $size = count($categories); for ($i = 0; $i < $size; $i++) { if($categories[$i]->parent != $a && $categories[$i]->term_id != $a){ unset($categories[$i]); } } } return $categories; } add_filter(‘get_terms’, ‘if_restrict_categories’); And … Read more

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