Skip to content

Instantly share code, notes, and snippets.

@Sinepel
Forked from luistinygod/tinygod-recover-roles.php
Created December 9, 2022 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sinepel/31f740771ee0e5fe401125f7f97504ab to your computer and use it in GitHub Desktop.
Save Sinepel/31f740771ee0e5fe401125f7f97504ab to your computer and use it in GitHub Desktop.
WordPress Plugin: Restores all the default roles and caps in the WordPress
<?php
/**
* Recover or Reset the default WordPress user roles and caps
* Install it as a WordPress plugin, activate it and deativate. That's it.
*
* @wordpress-plugin
* Plugin Name: tinyGod Recover User Roles
* Plugin URI:
* Author: luistinygod
* Author URI: https://tinygod.pt
* Version: 1.0.0
* Description: Recover User Roles
* Text Domain: rur
* Domain Path: /languages
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
defined( 'ABSPATH' ) || exit;
if ( !function_exists( 'populate_roles' ) ) {
require_once( ABSPATH . 'wp-admin/includes/schema.php' );
}
populate_roles();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment