Skip to content

Commit

Permalink
Define custom sanitize callback early, to allow override by $options
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Feb 20, 2016
1 parent 8f9554e commit 69dec43
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions php/class-fieldmanager-options.php
Expand Up @@ -55,6 +55,7 @@ abstract class Fieldmanager_Options extends Fieldmanager_Field {
* @param mixed $options
*/
public function __construct( $label = '', $options = array() ) {
$this->sanitize = array( $this, 'sanitize' );
parent::__construct( $label, $options );

if ( !empty( $this->options ) ) {
Expand All @@ -63,9 +64,6 @@ public function __construct( $label = '', $options = array() ) {

// Add the options CSS
fm_add_style( 'fm_options_css', 'css/fieldmanager-options.css' );

// Sanitization
$this->sanitize = array( $this, 'sanitize' );
}

/**
Expand Down

0 comments on commit 69dec43

Please sign in to comment.