Can editor role edit all posts

This topic contains 8 reply and 2 voices, and was last updated by jannon 10 years, 8 months ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
August 20, 2013 at 12:57 am 7163
jannon I have the free version and am happy to buy the pro if it is possible to set it so the editor role can see all posts from all users and be able to edit them. This is for an online magazine and their are several writers that contribute stories but they all have to be edited by our editor. I've looked through the documentation and forums but I can't seem to find out anything about this. thanks
August 20, 2013 at 1:26 am 7165
Tareq Hasan Tareq Hasan

The feature is not there in the plugin, but that can be achieved by modifying 1/2 lines of the plugin and via some filters. I can assist you with the pro version.

August 20, 2013 at 1:52 am 7171
Tareq Hasan Tareq Hasan

By default, editors can edit all users post. But the problem is the dashboard, it only shows the current users post. So below is the code that enables only editor roles to display all posts into their dashboard, so they can edit all of them. Insert the code in your themes functions.php

[php]

/**
* Get a user role type by user id
*
* @example
* returns by giving user id is: ‘administrator’ or ‘editor’ or ‘subscriber’
*
* @global object $wpdb
* @param int $user_id
* @return string
*/
function wedevs_get_user_role( $user_id ) {
global $wpdb;

$user = get_userdata( $user_id );

if ( $user->ID ) {
$capabilities = $user->{$wpdb->prefix . ‘capabilities’};

if ( !isset( $wp_roles ) ) {
$wp_roles = new WP_Roles();
}

foreach ($wp_roles->role_names as $role => $name) {
if ( array_key_exists( $role, $capabilities ) ) {
return $role;
}
}
}

return false;
}

function wpufe_dashboard_query( $args ) {
$user_id = get_current_user_id();

if ( $user_id && wedevs_get_user_role( $user_id ) == ‘editor’ ) {
unset( $args[‘author’] );
}

return $args;
}

add_filter( ‘wpuf_dashboard_query’, ‘wpufe_dashboard_query’ );
[/php]

August 20, 2013 at 1:55 am 7172
jannon jannon

Hi, I decided to buy the plugin but I’m having trouble with the labels on the registration form, they’re not showing.

August 20, 2013 at 2:01 am 7173
jannon jannon

Hi Tareq the code worked pretty well, the editor can see all of the posts but can’t edit them, just delete them.

August 20, 2013 at 2:07 am 7174
Tareq Hasan Tareq Hasan

Follow the setup of post editing and also re-save the plugin settings (Dashboard tab).

August 20, 2013 at 2:12 am 7175
jannon jannon

That fixed the editor dashboard. Thank you. I still don’t see the field labels on the registration form. Can you help me there?

August 20, 2013 at 2:24 am 7177
Tareq Hasan Tareq Hasan

Have you actually given any labels on the the registration form? Can you give a screenshot?

August 20, 2013 at 2:49 am 7181
jannon jannon

Sorry Tareq, I totally missed the filling out the label field. Thank you and great plugin.

Viewing 8 Posts - 1 through 8 (of 8 total)