password.php
| 1 | <?php |
| 2 | |
| 3 | class acf_field_password extends acf_field |
| 4 | { |
| 5 | |
| 6 | /* |
| 7 | * __construct |
| 8 | * |
| 9 | * Set name / label needed for actions / filters |
| 10 | * |
| 11 | * @since 3.6 |
| 12 | * @date 23/01/13 |
| 13 | */ |
| 14 | |
| 15 | function __construct() |
| 16 | { |
| 17 | // vars |
| 18 | $this->name = 'password'; |
| 19 | $this->label = __("Password",'acf'); |
| 20 | |
| 21 | |
| 22 | // do not delete! |
| 23 | parent::__construct(); |
| 24 | } |
| 25 | |
| 26 | |
| 27 | /* |
| 28 | * create_field() |
| 29 | * |
| 30 | * Create the HTML interface for your field |
| 31 | * |
| 32 | * @param $field - an array holding all the field's data |
| 33 | * |
| 34 | * @type action |
| 35 | * @since 3.6 |
| 36 | * @date 23/01/13 |
| 37 | */ |
| 38 | |
| 39 | function create_field( $field ) |
| 40 | { |
| 41 | echo '<input type="password" value="' . esc_attr( $field['value'] ) . '" id="' . esc_attr( $field['id'] ) . '" class="' . esc_attr( $field['class'] ) . '" name="' . esc_attr( $field['name'] ) . '" />'; |
| 42 | } |
| 43 | |
| 44 | } |
| 45 | |
| 46 | new acf_field_password(); |
| 47 | |
| 48 | ?> |