.circleci
assets
bin
data
inc
admin-pages
api
builders
checkout
compat
contracts
country
database
debug
deprecated
development
domain-mapping
duplication
exception
functions
gateways
helpers
installers
integrations
internal
invoices
limitations
class-limit-customer-user-role.php
class-limit-disk-space.php
class-limit-domain-mapping.php
class-limit-plugins.php
class-limit-post-types.php
class-limit-site-templates.php
class-limit-sites.php
class-limit-subtype.php
class-limit-themes.php
class-limit-users.php
class-limit-visits.php
class-limit.php
limits
list-tables
loaders
managers
mercator
models
next
objects
site-templates
sso
tax
traits
ui
updater
class-admin-notices.php
class-admin-themes-compatibility.php
class-ajax.php
class-api.php
class-async-calls.php
class-autoloader.php
class-cron.php
class-current.php
class-dashboard-statistics.php
class-dashboard-widgets.php
class-documentation.php
class-domain-mapping.php
class-faker.php
class-geolocation.php
class-helper.php
class-hooks.php
class-license.php
class-light-ajax.php
class-logger.php
class-maintenance-mode.php
class-newsletter.php
class-requirements.php
class-scripts.php
class-session-cookie.php
class-settings.php
class-sunrise.php
class-user-switching.php
class-views.php
class-whitelabel.php
class-wp-ultimo.php
lang
patches
tests
utils
views
.gitignore
.phpcs.xml.dist
LICENSE
autoload.php
composer.json
composer.lock
constants.php
loco.xml
package-lock.json
package.json
phpstan.neon.dist
phpunit.xml.dist
readme.txt
rector.php
setuptest.sh
sunrise.php
uninstall.php
wp-multisite-waas.php
77 lines
1.4 KiB
PHP
77 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Customer User Role Limit Module.
|
|
*
|
|
* @package WP_Ultimo
|
|
* @subpackage Limitations
|
|
* @since 2.0.10
|
|
*/
|
|
|
|
namespace WP_Ultimo\Limitations;
|
|
|
|
// Exit if accessed directly
|
|
defined('ABSPATH') || exit;
|
|
|
|
/**
|
|
* Customer User Role Limit Module.
|
|
*
|
|
* @since 2.0.10
|
|
*/
|
|
class Limit_Customer_User_Role extends Limit {
|
|
|
|
/**
|
|
* The module id.
|
|
*
|
|
* @since 2.0.10
|
|
* @var string
|
|
*/
|
|
protected $id = 'customer_user_role';
|
|
|
|
/**
|
|
* Returns a default state.
|
|
*
|
|
* @since 2.0.10
|
|
* @return array
|
|
*/
|
|
public static function default_state() {
|
|
|
|
return [
|
|
'enabled' => true,
|
|
'limit' => 'default',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* The check method is what gets called when allowed is called.
|
|
*
|
|
* Each module needs to implement a check method, that returns a boolean.
|
|
* This check can take any form the developer wants.
|
|
*
|
|
* @since 2.0.10
|
|
*
|
|
* @param mixed $value_to_check Value to check.
|
|
* @param mixed $limit The list of limits in this modules.
|
|
* @param string $type Type for sub-checking.
|
|
* @return bool
|
|
*/
|
|
public function check($value_to_check, $limit, $type = '') {
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Gets the limit data.
|
|
*
|
|
* @since 2.0.0
|
|
*
|
|
* @param string $type Type for sub-checking.
|
|
* @return mixed
|
|
*/
|
|
public function get_limit($type = '') {
|
|
|
|
$default_value = wu_get_setting('default_role', 'administrator');
|
|
|
|
return empty($this->limit) || 'default' === $this->limit ? $default_value : $this->limit;
|
|
}
|
|
}
|