Hi Brandon (and Todd),
mainly I’d like to thank you because your plugin saved who knows how many hours of work to a lot of people.
Secondarily I would like to ask how could I fix the following problem: since I don’t know which WP version, the line 103 of your plugin prevents it to do what it was made for, most likely because the user query is not anymore the one you defined in the regex.
How could I elegantly solve the problem? What WHERE part of the query should I re-write as a regex to make it work? I guess it’s not elegant at all to comment out that 103/106 block…right?
Thanks in advance for your precious help.
]]>Hi there,
Noticed what I think might be some unexpected undesired behavior here.
When installing, the plugin runs this…
$author_users_opt = array(
'who' => 'authors',
'name' => 'admin10x_install',
'class'=> 'authors',
'show' => 'display_name_with_login'
);
$authors = get_users( $author_users_opt );
foreach($authors as $author) {
error_log(json_encode($author->data));
$this->add_author($author->data->ID);
}
And from the docs…
https://codex.www.ads-software.com/Function_Reference/get_users
who - If set to 'authors', only authors (user level greater than 0) will be returned.
Then, on the set_user_role
action, it runs as follows…
add_action('set_user_role', function($user_id, $role) {
$a10x = new Admin10X();
$author_roles = array('administrator', 'author', 'editor');
if ( in_array($role, $author_roles)) {
$a10x->add_author($user_id);
} else {
$a10x->del_author($user_id);
}
}, 10, 3);
… which is a narrower slice.
So, for example, on install, the table will include contributors, however, when you add a new contributor they’re not in the table.
Proposed solution would be (a) a plugin setting for which roles are considered for this table and (b) update the plugin to use the value(s) from this setting for both the role__in
on the get_users()
and the $author_roles
in the set_user_role
action.
Thank you for this most excellent plugin that so elegantly solves the too many authors slow query in admin issue.
]]>Hi dear
I dont understand what is this plugin for?
I can accelerate my admin dashboard with this?
Thanks for support
]]>