Tag Info

New answers tagged


I've done something similar to the accepted answer here but only wanted to show admins and in my case, a custom 'producers' role, together. add_filter('wp_dropdown_users', 'custom_author_select'); function custom_author_select($output){ //global $post is available here, hence you can check for the post type here $admins = ...


add_action('future_to_pending', 'send_emails_on_new_event'); add_action('new_to_pending', 'send_emails_on_new_event'); add_action('draft_to_pending', 'send_emails_on_new_event'); add_action('auto-draft_to_pending', 'send_emails_on_new_event'); /** * Send emails on event publication * * @param WP_Post $post */ function send_emails_on_new_event($post) { ...


As it happens, I have something very similar on one of my sites to to allow Administrators update some custom user meta. Basically, you need to add an additional column and then populate it with a link to do what you want. When you click the link some jQuery fires of an AJAX request to update the user role and then you are redirected back the the ...


User roles and associated capabilities are all stored in the $prefix_options table in the $prefix_user_roles (note that in both of these $prefix is a variable, so if your $prefix is foo_, your table will be foo_options). You need to sync this value between databases. As far as I'm aware, there is not a way to sync just this one option beyond connecting to ...


Okay here we go. It is a bug in WordPress itself. I have already shortly explained the issue in my question, so either have a look at it or check out the ticket linked above for more details. Until the issue is properly resolved I propose this dirty, dirty hack. It is based off the idea that as soon as another sub-menu that is accessible is added ...


change in_array('contributor',$user->roles) to (in_array('contributor',$user->roles) || in_array('administrator',$user->roles))


A quick and dirty way of doing this is by adding a .htaccess file to the wp-admin directory, with the following content. <FilesMatch "^options-(.*)\.php$"> Order Allow,Deny Deny from all </FilesMatch>


Checkout User Roles and Capabilities Plugin

Top 50 recent answers are included