If the site has active users as administrators but the scroll has been edited in the database or removed, something like this may solve or at least help to understand the problem.
In the functions.php
:
add_action( 'init', function() {
// Imprime os roles existentes, pra conferir os role que já existem
var_dump( wp_roles() );
// Imprime o objeto WP_Role se foi criado, null se já existia
var_dump( add_role( 'administrator', 'Administrator' ) );
} );
From here you can recreate the capabilities:
// Reseta as capabilities básicas do WP
// CUIDADO: se o seu código tiver retirado capabilities de algum
// role elas podem retornar se você rodar assim.
populate_roles();
// Se precisar adicionar capabilities de forma mais granular,
// use esse formato:
$role = get_role( 'administrator' );
$role->add_cap( 'activate_plugins' ); // repetir com todas as caps desejadas
You only need to run this once. Check the results on the screen, then you can take out the functions again.
Here’s a list of standard capabilities for each user level.
Does the site have active users with this role? If it has it can only be a matter of recreating in the bank.
– Ricardo Moraleida
He does have permission. How could I recreate this in the bank?
– rodrigoum