rule-collect-error-trait.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Validation\Advanced_Rules\Traits; |
| 5 | |
| 6 | // If this file is called directly, abort. |
| 7 | if ( ! defined( 'WPINC' ) ) { |
| 8 | die; |
| 9 | } |
| 10 | |
| 11 | use JFB_Modules\Block_Parsers\Field_Data_Parser; |
| 12 | |
| 13 | trait Rule_Collect_Error_Trait { |
| 14 | |
| 15 | public function collect_error( Field_Data_Parser $parser ) { |
| 16 | $parser->collect_error( 'rule:' . $this->get_id(), $this->get_setting( 'message' ) ); |
| 17 | } |
| 18 | |
| 19 | } |
| 20 |