- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.1 KiB
PHP
Executable File
57 lines
1.1 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* The Role wizard step
|
|
*
|
|
* @since 0.9.0
|
|
* @package RankMath
|
|
* @subpackage RankMath\Wizard
|
|
* @author Rank Math <support@rankmath.com>
|
|
*/
|
|
|
|
namespace RankMath\Wizard;
|
|
|
|
use RankMath\Helper;
|
|
use RankMath\Role_Manager\Capability_Manager;
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* Step class.
|
|
*/
|
|
class Role implements Wizard_Step {
|
|
/**
|
|
* Get Localized data to be used in the Compatibility step.
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function get_localized_data() {
|
|
Helper::is_configured( true );
|
|
|
|
return array_merge(
|
|
Helper::get_roles_capabilities(),
|
|
[
|
|
'role_manager' => Helper::is_module_active( 'role-manager' ),
|
|
'roles' => Helper::get_roles(),
|
|
'capabilities' => Capability_Manager::get()->get_capabilities(),
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Save handler for step.
|
|
*
|
|
* @param array $values Values to save.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function save( $values ) {
|
|
if ( empty( $values ) ) {
|
|
return false;
|
|
}
|
|
|
|
Helper::update_modules( [ 'role-manager' => $values['role_manager'] ? 'on' : 'off' ] );
|
|
Helper::set_capabilities( $values );
|
|
return true;
|
|
}
|
|
}
|