mode = wu_get_isset($data, 'mode', 'default'); } /** * Returns the mode. Can be one of three: default, assign_template and choose_available_templates. * * @since 2.0.0 * @return string */ public function get_mode() { return $this->mode; } /** * 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.0 * * @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 = '') { $check = true; return $check; } /** * Returns default permissions. * * @since 2.0.0 * * @param string $type Type for sub-checking. * @return array */ public function get_default_permissions($type) { return [ 'behavior' => 'available', ]; } /** * Returns a default state. * * @since 2.0.0 * @return array */ public static function default_state() { return [ 'enabled' => true, 'limit' => null, 'mode' => 'default', ]; } }