New answers tagged

1

While you can't edit the dropdown list, you can achieve what you want as long as you are able to edit your theme or if your theme uses the standard the_author() template tag. To recast your question, you want: Editor's names to show as Name + nickname + surname Other names to show as nickname No-one to be able to change this except Admins I'm assuming ...


0

The edit_others_posts capability should allow users to set the author of a post. At first glance you might reply that you don't want your authors to be able to edit one another's posts. The difference in ability is very subtle though: writing a post and then assigning it to another user isn't much different from being able to write or edit that other user'...


0

I just want to point out that some people may still have an empty site users table—specifically for their root site. If this problem occurs, the way to fix it issue is by doing the following: Go to the table wp_usermeta Find any entries with the meta_key wp_capabilities Change the meta_key from wp_capabilities to wp_1_capabilities I believe "1" is ...


-1

It really depends on why you want to manage your users. If it's just to have additional content editors or contributors, what comes out of the box will work just fine. If you are meaning to create a membership site where people have to log in to see specific content they paid for I would suggest WooCommerce Membership. It's very easy to use and set up is ...


0

I had the same problem, a custom role couldn't assign categories to my CPT. When doing register_taxonomy(), I added these capabilities: 'capabilities' => array ( 'manage_terms' => 'manage_options', //by default only admin 'edit_terms' => 'manage_options', 'delete_terms' => '...


0

First remove the category metabox from the post edit screen for this particular role, let's name it onecat-author: if (current_user_can('onecat-author')) { remove_meta_box ('category', 'post', 'normal'); } Next, when the post is saved use the available hook to assign the category: if (current_user_can('onecat-author')) { add_action ('save_post', ...


0

You can basically deactivate whole plugin only based on the information you have at wordpress "boot" time, which is basically the URL and cookies. Any check more complex then that will probably have to wait until boot is completed to be able to be executed, at which time the plugin is already loaded and it is too late to "deactivate" it.


5

You can try below code - <?php global $current_user; if ((is_user_logged_in() && $current_user->ID == $post->post_author) || current_user_can( 'manage_options' )) { echo 'my post'; } ?> Check below link also- https://codex.wordpress.org/Function_Reference/current_user_can


0

Solution, using and statement '&&' for another specific role. Closing <?php if() : ?>, <?php else : ?> Tag with a Column : to be able to post scripts inside the Loop. <?php global $current_user; // Use global get_currentuserinfo(); // Make sure global is set, if not set it. if ( ! user_can( $current_user, "administrator") && ...


0

I made the database changes as instructed but when I signed in as an administrator I still could'nt alter users or pages. When comparing the database field for user roles I noticed it was different from other Wordpress installations. My solution was this: Find the field named "wp_user_roles" in the table named [database prefix]_options, e.g. "wp_options", ...


1

You need to make a custom query to display these pending posts. Here is an example using get_posts(): $args = array( 'post_type' => 'post_type_name', 'post_status' => 'pending', // -1 shows all 'posts_per_page' => -1, ); $pending_posts = get_posts( $args ); foreach( $pending_posts as $pending_post ) { // post object properties ...


1

@bravokeyl is the probably the best answer to your immediate problem. But to address the following: Is there a way to hook into an action or filter and remove ALL the update nag messages for non-admin users? No. Nag messages in WordPress are just a callback to added to the admin_notices hook which print some HTML to the page. They are practically ...


7

In wp-admin/includes/update.php file if ( current_user_can('update_core') ) $msg = sprintf( __('An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.'), 'update-core.php' ); else $msg = __('An automated WordPress update has failed to complete! Please notify the site ...


0

If you don't want to install a plugin to just to do this one task, you can call the WordPress function directly to rebuild the roles and their capabilities. if ( !function_exists( 'populate_roles' ) ) { require_once( ABSPATH . 'wp-admin/includes/schema.php' ); } populate_roles();



Top 50 recent answers are included