You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
537 B
22 lines
537 B
9 months ago
|
<?php
|
||
|
defined( 'ABSPATH' ) || die;
|
||
|
|
||
|
/**
|
||
|
* The secured password field.
|
||
|
*/
|
||
|
class RWMB_Password_Field extends RWMB_Input_Field {
|
||
|
/**
|
||
|
* Store secured password in the database.
|
||
|
*
|
||
|
* @param mixed $new The submitted meta value.
|
||
|
* @param mixed $old The existing meta value.
|
||
|
* @param int $post_id The post ID.
|
||
|
* @param array $field The field parameters.
|
||
|
* @return string
|
||
|
*/
|
||
|
public static function value( $new, $old, $post_id, $field ) {
|
||
|
$new = $new !== $old ? wp_hash_password( $new ) : $new;
|
||
|
return $new;
|
||
|
}
|
||
|
}
|