文件操作 - IsRequired.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Framework/FieldsAPI/Concerns/IsRequired.php
编辑文件内容
<?php namespace Give\Framework\FieldsAPI\Concerns; trait IsRequired { /** * Marks the field as required or not. * * @since 2.24.0 switch to new validation system */ public function required($value = true): self { if ( $value ) { $this->validationRules->rules('required'); } else { $this->validationRules->removeRuleWithId('required'); } return $this; } /** * Returns whether the field is required or not. * * @since 2.24.0 switch to new validation system */ public function isRequired(): bool { return $this->hasRule('required'); } /** * @deprecated Use the Validator to generate errors */ public function getRequiredError(): array { return [ 'error_id' => $this->name, 'error_message' => __('Please enter a value for ', 'give') . $this->name, ]; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件