Skip to content

Commit

Permalink
Merge pull request #6 from DrewAPicture/class_arg
Browse files Browse the repository at this point in the history
Rename the 'class' argument passed to add_settings_field() to 'callback'
  • Loading branch information
Austin Passy committed Apr 25, 2015
2 parents b5b410d + e6cd097 commit 3da8069
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-cl-settings-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ public function admin_init() {
'options' => isset( $option['options'] ) ? $option['options'] : '',
'default' => isset( $option['default'] ) ? $option['default'] : '',
'sanitize' => isset( $option['sanitize'] ) ? $option['sanitize'] : '',
'class' => isset( $option['class'] ) ? $option['class'] : $this,
'callback' => isset( $option['class'] ) ? $option['class'] : $this,
);
$args = wp_parse_args( $args, $option );

add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $args['class'], 'callback_' . $type ), $section, $section, $args );
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $args['callback'], 'callback_' . $type ), $section, $section, $args );
}
}

Expand Down

0 comments on commit 3da8069

Please sign in to comment.