Skip to content

Commit

Permalink
fixes #1253
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Feb 4, 2017
1 parent f818c07 commit 4701524
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions field/class-kirki-field-sortable.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ protected function set_type() {
*/
protected function set_sanitize_callback() {

$this->sanitize_callback = array( 'Kirki_Field_Sortable', 'sanitize' );
$this->sanitize_callback = array( $this, 'sanitize' );

}

/**
* Sanitizes sortable values.
*
* @static
* @access public
* @param array $value The checkbox value.
* @return bool
*/
public static function sanitize( $value = array() ) {
public function sanitize( $value = array() ) {

if ( is_string( $value ) || is_numeric( $value ) ) {
return array(
Expand All @@ -53,7 +52,9 @@ public static function sanitize( $value = array() ) {
}
$sanitized_value = array();
foreach ( $value as $sub_value ) {
$sanitized_value[] = esc_attr( $sub_value );
if ( isset( $this->choices[ $sub_value ] ) ) {
$sanitized_value[] = esc_attr( $sub_value );
}
}
return $sanitized_value;

Expand Down

0 comments on commit 4701524

Please sign in to comment.