Move the validate checkbox method above select

This commit is contained in:
Shiva Poudel 2015-05-25 16:58:08 +05:45
parent 4d46b35590
commit 2871df7451
1 changed files with 21 additions and 21 deletions

View File

@ -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.
*