Linux webm002.cluster126.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
/
home
/
ariannadhf
/
www
/
wp-content
/
plugins
/
admin-menu-editor
/
customizables
/
Settings
/
/home/ariannadhf/www/wp-content/plugins/admin-menu-editor/customizables/Settings/IntegerSetting.php
<?php namespace YahnisElsts\AdminMenuEditor\Customizable\Settings; class IntegerSetting extends NumericSetting { protected $dataType = 'integer'; public function validate($errors, $value, $stopOnFirstError = false) { $numValue = parent::validate($errors, $value); if ( is_wp_error($numValue) || ($numValue === null) ) { return $numValue; } //The value must be an integer (no decimals). if ( $numValue !== floor($numValue) ) { $errors->add('not_integer', 'Value must be an integer'); return $errors; } return intval($value); } public function serializeValidationRules() { $result = parent::serializeValidationRules(); if ( !isset($result['parsers']) ) { $result['parsers'] = []; } $result['parsers'][] = ['int']; return $result; } }