| 1 |
<?php |
| 2 |
/** |
| 3 |
* Merchant Field Interface. |
| 4 |
* |
| 5 |
* Defines the contract that all field types must follow. |
| 6 |
* |
| 7 |
* @package Merchant |
| 8 |
* @since 2.2.5 |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; // Exit if accessed directly |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Merchant_Field_Interface |
| 17 |
* |
| 18 |
* @since 2.2.5 |
| 19 |
*/ |
| 20 |
interface Merchant_Field_Interface { |
| 21 |
|
| 22 |
/** |
| 23 |
* Render the field HTML output. |
| 24 |
* |
| 25 |
* @since 2.2.5 |
| 26 |
* @return void |
| 27 |
*/ |
| 28 |
public function render(); |
| 29 |
|
| 30 |
/** |
| 31 |
* Sanitize the submitted field value. |
| 32 |
* |
| 33 |
* @since 2.2.5 |
| 34 |
* |
| 35 |
* @param mixed $value The raw submitted value. |
| 36 |
* |
| 37 |
* @return mixed The sanitized value. |
| 38 |
*/ |
| 39 |
public function sanitize( $value ); |
| 40 |
|
| 41 |
/** |
| 42 |
* Preprocess the field value before saving. |
| 43 |
* |
| 44 |
* @since 2.2.5 |
| 45 |
* |
| 46 |
* @param mixed $value The sanitized value. |
| 47 |
* |
| 48 |
* @return mixed The preprocessed value. |
| 49 |
*/ |
| 50 |
public function preprocess( $value ); |
| 51 |
} |
| 52 |
|