Allow user to Publish, but not Edit or Delete

I am not sure what you’re trying to do by not allowing Edit. Its only a job of Publishing the post it seems. (or maybe add some Meta description etc) But, if you’re looking at creating a Moderator, you need to create additional user group & assign permissions. You can try http://wordpress.org/plugins/advanced-access-manager/ or similar plugins … Read more

How can I prevent users from creating new categories?

You should to remove a capability named ‘manage_categories’ from user role or roles, for example: /** * Don’t let subscribers add/edit/remove categories. * * You should call the function once when your plugin or theme is activated. * * @uses WP_Role::remove_cap() */ function remove_subscribers_manage_categories() { // get_role returns an instance of WP_Role. $role = get_role( … Read more

Return ID of authors who have at least one post

Instead of a JOIN, you can use a IN with a subquery, to prevent duplicate results because of the join: SELECT ID, display_name FROM wp_users WHERE ID IN (SELECT post_author FROM wp_posts) This will not look at capabilities. If you also want that you can add them like a join, but move the meta_key clause … Read more

Customize the upload screen

You will need to hook into attachment_fields_to_edit and unset them for a role. You can use current_user_can(‘author’) http://codex.wordpress.org/Function_Reference/current_user_can Example to remove image alt field function remove_caption($form_fields) { if (current_user_can(‘author’)){ $form_fields[‘image_alt’][‘input’] = ‘hidden’; return $form_fields; }} add_filter(‘attachment_fields_to_edit’,’remove_caption’, 15, 2); My initial post used unset but I tried it and it did not work, from the example … Read more

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