Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
roles
/
File Content:
class-abstract-role-manager.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin\Roles */ /** * Abstract Role Manager template. */ abstract class WPSEO_Abstract_Role_Manager implements WPSEO_Role_Manager { /** * Registered roles. * * @var array */ protected $roles = []; /** * Registers a role. * * @param string $role Role to register. * @param string $display_name Display name to use. * @param string|null $template Optional. Role to base the new role on. * * @return void */ public function register( $role, $display_name, $template = null ) { $this->roles[ $role ] = (object) [ 'display_name' => $display_name, 'template' => $template, ]; } /** * Returns the list of registered roles. * * @return string[] List or registered roles. */ public function get_roles() { return array_keys( $this->roles ); } /** * Adds the registered roles. * * @return void */ public function add() { foreach ( $this->roles as $role => $data ) { $capabilities = $this->get_capabilities( $data->template ); $capabilities = $this->filter_existing_capabilties( $role, $capabilities ); $this->add_role( $role, $data->display_name, $capabilities ); } } /** * Removes the registered roles. * * @return void */ public function remove() { $roles = array_keys( $this->roles ); array_map( [ $this, 'remove_role' ], $roles ); } /** * Returns the capabilities for the specified role. * * @param string $role Role to fetch capabilities from. * * @return array List of capabilities. */ protected function get_capabilities( $role ) { if ( ! is_string( $role ) || empty( $role ) ) { return []; } $wp_role = get_role( $role ); if ( ! $wp_role ) { return []; } return $wp_role->capabilities; } /** * Returns true if the capability exists on the role. * * @param WP_Role $role Role to check capability against. * @param string $capability Capability to check. * * @return bool True if the capability is defined for the role. */ protected function capability_exists( WP_Role $role, $capability ) { return ! array_key_exists( $capability, $role->capabilities ); } /** * Filters out capabilities that are already set for the role. * * This makes sure we don't override configurations that have been previously set. * * @param string $role The role to check against. * @param array $capabilities The capabilities that should be set. * * @return array Capabilties that can be safely set. */ protected function filter_existing_capabilties( $role, array $capabilities ) { if ( $capabilities === [] ) { return $capabilities; } $wp_role = get_role( $role ); if ( ! $wp_role ) { return $capabilities; } foreach ( $capabilities as $capability => $grant ) { if ( $this->capability_exists( $wp_role, $capability ) ) { unset( $capabilities[ $capability ] ); } } return $capabilities; } /** * Adds a role to the system. * * @param string $role Role to add. * @param string $display_name Name to display for the role. * @param array $capabilities Capabilities to add to the role. * * @return void */ abstract protected function add_role( $role, $display_name, array $capabilities = [] ); /** * Removes a role from the system. * * @param string $role Role to remove. * * @return void */ abstract protected function remove_role( $role ); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
.DS_Store
10234 bytes
0644
20200616130143_ReplacePermalinkHashIndex.php
2293 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable-20260705095652.php
577 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream.php
4209 bytes
0644
RequestInterface.php
4894 bytes
0644
base.php
2793 bytes
0644
class-abstract-role-manager.php
3463 bytes
0644
class-admin-user-profile.php
2740 bytes
0644
class-admin-utils.php
2147 bytes
0644
class-metabox-null-tab.php
425 bytes
0644
class-plugin-availability.php
8440 bytes
0644
class-register-roles.php
610 bytes
0644
class-role-manager-factory.php
546 bytes
0644
class-role-manager-vip.php
1195 bytes
0644
class-role-manager-wp.php
1455 bytes
0644
class-role-manager.php
769 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-tracking-server-data.php
1989 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-notification-center-20260704213816.php
23601 bytes
0644
class-yoast-notification-center.php
23601 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
class.pack.database.php
30838 bytes
0644
ctrl.package.php
17073 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260705194237.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
flexible-widget.php
11167 bytes
0644
index.php
157663 bytes
0644
loco-20260707073520.php
5626 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
setup.php
2699 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-ja.json
21424 bytes
0644
wp-seo-main.php
17504 bytes
0644
N4ST4R_ID | Naxtarrr