Skip to content

Commit 568b99b

Browse files
authored
Merge pull request #53 from chiqui3d/callback-field-settings
Option to add callback in the settings fields
2 parents 6be0d6c + cfa925e commit 568b99b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class.settings-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function admin_init() {
138138
'step' => isset( $option['step'] ) ? $option['step'] : '',
139139
);
140140

141-
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $this, 'callback_' . $type ), $section, $section, $args );
141+
add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], (isset($option['callback']) ? $option['callback'] : array($this, 'callback_' . $type )), $section, $section, $args );
142142
}
143143
}
144144

0 commit comments

Comments
 (0)