Move the validate checkbox method above select
This commit is contained in:
parent
4d46b35590
commit
2871df7451
|
@ -766,27 +766,6 @@ abstract class WC_Settings_API {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Checkbox Field.
|
||||
*
|
||||
* If not set, return "no", otherwise return "yes".
|
||||
*
|
||||
* @param mixed $key
|
||||
* @since 1.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function validate_checkbox_field( $key ) {
|
||||
|
||||
$status = 'no';
|
||||
$field = $this->get_field_key( $key );
|
||||
|
||||
if ( isset( $_POST[ $field ] ) && ( 1 == $_POST[ $field ] ) ) {
|
||||
$status = 'yes';
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Text Field.
|
||||
*
|
||||
|
@ -907,6 +886,27 @@ abstract class WC_Settings_API {
|
|||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Checkbox Field.
|
||||
*
|
||||
* If not set, return "no", otherwise return "yes".
|
||||
*
|
||||
* @param mixed $key
|
||||
* @since 1.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function validate_checkbox_field( $key ) {
|
||||
|
||||
$status = 'no';
|
||||
$field = $this->get_field_key( $key );
|
||||
|
||||
if ( isset( $_POST[ $field ] ) && ( 1 == $_POST[ $field ] ) ) {
|
||||
$status = 'yes';
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Select Field.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue